Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

If Nginx serves your HTML but the page has no styling, first inspect the exact stylesheet request in your browser’s Network panel. The status code, response body, and Content-Type usually identify the fault: a 404 means the URI does not map to the file, a 403 means Nginx cannot access it, and a 200 response containing HTML usually means a proxy or single-page-app fallback intercepted the request. A successful stylesheet response must contain the actual CSS and use Content-Type: text/css.

Fix the mapping in the active server and location blocks, verify the file and every parent directory, include the CSS MIME mapping, then run sudo nginx -t and reload Nginx. The procedure below follows the request from browser to URL routing, filesystem access, MIME handling, logs, and cache so you can correct the underlying problem instead of masking it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Start with the response the browser is actually receiving

Do not begin by changing random Nginx directives. The browser’s request is the most reliable description of what is failing. Open developer tools, select the Network panel, enable a reload that bypasses the browser’s current page where practical, and reload the page. Select the CSS request and record its complete URL, status, response headers, and the first bytes of the response body.

  • 404 Not Found: Nginx could not find the requested path, or a route deliberately returned a missing-file response.
  • 403 Forbidden: a file, parent directory, location rule, or explicit deny rule blocked access.
  • 200 with HTML: a reverse proxy, SPA fallback, custom error page, or rewrite returned an application document instead of CSS.
  • 200 with CSS but an unexpected type: inspect MIME configuration and any location-level default_type.
  • Redirect to another host or path: follow the redirect and verify that the final request still points to the intended asset.

Confirm that the URL shown in Network is the URL emitted by the page source or template. A relative reference such as css/app.css resolves differently from /static/css/app.css when the page is nested under another path.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application:Upgraded attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.

Confirm the origin response from a shell

Run a header request and then inspect the body:

curl -I https://example.com/static/css/app.css
curl -sS https://example.com/static/css/app.css | head

The first command shows the status, redirects, and response headers. The second exposes the common “HTML returned for a CSS URL” error immediately: an HTML document normally starts with markup such as <!doctype html>, while a real stylesheet starts with CSS rules or comments. If the site is behind a cache or CDN, perform an equivalent request directly against the origin or use a temporary cache-bypass query so you know whether the defect is at Nginx or in a cached response.

Map the stylesheet URL to the file Nginx should serve

Nginx’s root directive defines the directory in which it searches. Nginx appends the request URI to that root. With root /var/www/site;, a request for /static/css/app.css maps to /var/www/site/static/css/app.css. The browser URL and the real filesystem path must therefore agree exactly, including directory names and filename case.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check the server block that is handling the request

Before editing anything, verify the intended server_name, listening port, and TLS server. A request can land in a default server because the hostname does not match, or because DNS points to a different machine. Display the complete loaded configuration, including files pulled in with include:

sudo nginx -T | less

Search that output for the hostname, the stylesheet URI prefix, root, alias, try_files, proxy_pass, rewrites, and error_page. The configuration on disk is not necessarily the configuration currently loaded by the running master process; nginx -T shows the effective configuration Nginx can parse.

Understand location precedence

Nginx does not always use the broad location / block. A longer prefix location can win, and a regular-expression location can take precedence according to Nginx’s selection rules. A nested block may redefine root, set a different default_type, proxy the request, or rewrite the URI. Inspect every location that can match the stylesheet path, not just the one you expect to use.

Configuration detail What to verify Typical symptom
server_name and listen The request hostname and port select the intended virtual server. HTML or a 404 from an unrelated site.
Prefix or regex location No more-specific block intercepts the asset. 200 HTML, unexpected redirect, or a different root.
root The directory plus URI produces the real file path. 404 despite a file existing elsewhere.
alias The URI replacement and trailing slashes are consistent. 404 or a path with a duplicated/missing directory.
try_files, rewrites, and proxying Missing assets end with an intentional 404 rather than an application route. 200 response containing the site’s HTML shell.

Root and alias are not interchangeable

With root, Nginx keeps the request URI and appends it to the root directory:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
location /static/ {
    root /var/www/site;
}

A request for /static/css/app.css is searched as /var/www/site/static/css/app.css.

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

With alias, Nginx replaces the matching location prefix. This is useful when the URL directory does not appear in the filesystem path:

location /static/ {
    alias /srv/assets/;
}

Here, /static/css/app.css maps to /srv/assets/css/app.css. Keep the trailing slash on both the location and the directory when the location represents a directory. A mismatch such as location /static/ with an alias intended for a single file, or an alias that omits the final slash, can produce surprising paths. If you need one file rather than a directory, use a precise location and verify the resulting replacement explicitly.

Install a minimal static-file location before adding complexity

Reduce the problem to a known-good static configuration. The following example serves a site from /var/www/site and makes every missing file under /static/ an intentional 404:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
server {
    listen 80;
    server_name example.com;
    root /var/www/site;

    location /static/ {
        try_files $uri =404;
    }
}

try_files checks whether the requested file or directory exists. The final parameter, =404, tells Nginx to stop with a 404 when it does not. Without that explicit terminal result, a general fallback can pass the request to an application that returns HTML. That HTML may have a 200 status, yet it is not a stylesheet and the browser will reject it.

Use this configuration only as a diagnostic baseline; preserve your existing HTTPS, compression, cache headers, and application routes as required. The important properties are that the selected location points at the correct root or alias and that a missing CSS file cannot fall through to a page-rendering route.

Test the mapping without a browser

After identifying the expected path, compare it directly with the server:

curl -sSI https://example.com/static/css/app.css
echo
curl -sS https://example.com/static/css/app.css | head

A correct result has a successful status, the stylesheet’s bytes, and a CSS content type. If the status is 404, check the URI, root/alias calculation, build output directory, and filename case before changing MIME settings. MIME configuration cannot make a missing file appear.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

Verify the file and every directory in its path

On the server, run stat against the exact path calculated from the active configuration:

sudo stat /var/www/site/static/css/app.css
namei -l /var/www/site/static/css/app.css

stat confirms that the file exists and shows its owner and mode. namei -l displays permissions for each component of the path, which is critical because Nginx must traverse every parent directory before it can read the file.

Interpret permission failures

The Nginx worker user needs execute (traverse) permission on each parent directory and read permission on the CSS file. The file does not need to be writable by Nginx, and making the whole document root writable is an unnecessary security risk. If the error log reports open() ... failed (13: Permission denied), identify the first directory or file in the path that blocks the worker and correct only that permission or ownership.

  • Check the worker identity in the main Nginx configuration, commonly through the user directive.
  • Ensure each parent directory permits traversal for that user or one of its groups.
  • Ensure the file permits read access.
  • Check for filesystem or location-level deny rules that are independent of Unix mode bits.
  • Repeat stat and namei -l after deployment if a build process replaced directories or files.

Filename case matters on typical Linux filesystems. A reference to App.css does not match a file named app.css, even if the development machine used a case-insensitive filesystem.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Make sure Nginx sends Content-Type: text/css

The browser expects a stylesheet response with the CSS MIME type. In the http block, include the distribution’s MIME map and retain a safe fallback for unknown extensions:

http {
    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    # server blocks and locations follow here
}

The standard mapping contains text/css css. A location-level default_type can override the value inherited from the http block, so inspect nested locations if the header is wrong. Verify the live response rather than relying on the configuration file:

curl -sSI https://example.com/static/css/app.css | grep -iE 'HTTP/|content-type|location'
  • text/css: MIME handling is correct; continue with body, CSP, mixed-content, or caching checks if the browser still refuses the file.
  • text/html: the request likely reached an HTML fallback, proxy, or custom error page.
  • application/octet-stream or text/plain: inspect the MIME include and any location-level type override.

Changing the MIME type does not fix a response whose body is HTML. Correct both the route and the header.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Use access and error logs to correlate one request

Nginx’s access and error logs show which status was generated and why file opening or routing failed. Follow both while requesting the stylesheet once:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo tail -f /var/log/nginx/access.log /var/log/nginx/error.log

Correlate the timestamp, request URI, host, and status. The error log often includes the path Nginx attempted to open, which lets you compare its calculation with the path from root or alias.

Observed result Most likely causes Next check
404 Wrong URI, wrong root or alias, filename case mismatch, or build output in another directory. Recalculate the path and run stat on it.
403 Parent-directory traversal failure, unreadable file, directory access restriction, or explicit deny rule. Run namei -l and inspect the matching location.
200 with HTML SPA fallback, reverse-proxy route, rewrite, or custom error page intercepted the asset. Inspect the response’s first bytes and add an explicit static-file 404.
200 with CSS but browser rejection Incorrect MIME, Content Security Policy, mixed-content blocking, or stale cached response. Check response headers, browser console, and a direct origin request.

Do not infer a path problem solely from the page looking unstyled. The browser console may report a MIME mismatch, CSP violation, or mixed-content block even when Nginx returned a 200 response.

Apply configuration changes safely

Nginx does not use an edited file until its configuration is parsed and reloaded. Run the syntax check first:

sudo nginx -t

Only after a successful test, ask the master process to reload:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo nginx -s reload

The reload signal applies the new configuration while existing workers finish their current requests. If the syntax test or reload fails, the previous working configuration remains in place; read the reported filename and line number, correct that error, test again, and then reload. Re-run the CSS curl request after the reload so you are testing the new configuration rather than an old worker state.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Separate origin delivery from cache behavior

Once the origin returns the correct status, CSS body, and Content-Type: text/css, investigate caches. A browser or intermediary can continue serving an old HTML error response even after Nginx is fixed. Request the origin directly when possible, or use a temporary cache-bypass query, and compare the response with what the browser receives.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

If the origin is correct but the cached response is not, invalidate the affected object or publish the asset under a new versioned filename. Cache busting is useful only after the URL maps to a real, readable CSS file; it cannot repair a wrong root, missing build output, permission denial, or missing MIME mapping. Check cache-related headers and confirm that the intermediary is not caching a 404 or application fallback for the stylesheet URL.

Common deployment patterns and their safe fixes

Static files below the document root

For a build that writes static/css/app.css beneath the document root, use root and verify that the generated directory is deployed to that exact location. Do not point Nginx at the source project directory if the production build emits files elsewhere.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Assets stored outside the document root

Use an alias when the public URI should map to a separate asset directory. Check the replacement carefully and retain matching trailing slashes for directory locations. Test one known file with stat and curl before adding broad patterns.

Single-page application fallback

A common application configuration sends every unknown URI to an HTML entry point. That is appropriate for client-side routes but wrong for missing CSS. Put the static asset location in a more specific block and terminate missing files with try_files $uri =404; so an absent stylesheet cannot be replaced by the app shell.

Reverse-proxied applications

If a location contains proxy_pass, determine whether Nginx is supposed to serve the asset itself or forward it. A proxy may return HTML, add a redirect, or generate an application-level 404. Keep static assets in a dedicated location when they are present on the Nginx host, and verify the upstream behavior when they are generated by the application.

A repeatable repair checklist

  1. Copy the exact CSS URL from the browser’s Network panel, including scheme, host, path, and any redirect.
  2. Record status, response headers, and the first bytes of the response body.
  3. Run curl -I and a short body request against the same URL.
  4. Use sudo nginx -T to identify the active server, winning location, root or alias, rewrites, proxying, and fallback rules.
  5. Calculate the filesystem path and verify it with stat; check every directory with namei -l.
  6. Correct filename case, build output placement, parent-directory traversal, or file-read permissions as indicated by the logs.
  7. Ensure the http block includes the MIME map and that no nested location overrides the CSS type.
  8. Add or verify try_files $uri =404; for the static asset location so missing files do not become HTML.
  9. Watch access and error logs while making one test request.
  10. Run sudo nginx -t, then sudo nginx -s reload.
  11. Repeat the origin request and confirm a real CSS body with Content-Type: text/css.
  12. Only after origin delivery is correct, clear or bypass browser/CDN caches and retest the page.

When these checks agree—the URL maps to the existing file, Nginx can traverse and read it, the selected location does not proxy or fall back, and the response is typed as CSS—the browser can load the stylesheet normally. Any remaining rejection should then be investigated in browser security and caching diagnostics rather than by changing the filesystem mapping again.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.