Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
VGSources
Blog

Nginx Installed but Your Site Won’t Load: A Complete Troubleshooting Guide

A running Nginx process does not guarantee that your domain reaches the right site. Follow this evidence-first guide to diagnose listeners, server blocks, static files, reverse proxies, logs, HTTPS and common 404, 502 and timeout errors.
Length12 min Posted Quest giverVGSources Team

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.

If Nginx is installed but your domain does not show the site you expect, work from the network boundary inward: confirm that the request reaches the machine, verify the address and port Nginx is listening on, prove which server block matches the Host header, then test either the static files or the proxied application. A running Nginx process alone proves none of those things. The fastest evidence is usually in the loaded configuration and the access and error logs.

What a running Nginx process does—and does not—prove

Nginx can be active while your public site still fails for several independent reasons. The service may be listening only on loopback, the firewall may block the public port, DNS may point somewhere else, or the request may reach Nginx but select a different virtual server. A selected server block can then return a 404, serve the default welcome page, or send the request to an unavailable application.

As an Amazon Associate I earn from qualifying purchases.

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.

Think of the request as passing through five boundaries:

  • Client and DNS: the browser resolves the hostname and connects to the intended IP address.
  • Listener: the machine accepts traffic on the expected address and port.
  • Server selection: Nginx matches the address, port, and Host header to a server block.
  • Content handling: that block maps the URI to a file, rewrite, or location rule.
  • Upstream handling: a reverse proxy connects to the application named by proxy_pass.

Test these boundaries in that order. Changing application code before proving that the correct server block receives the request often hides the real fault.

#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter | 4Pack Type C Female to A Male Cable Converter for Apple Duo 17 16 15 14 Plus,iWatch Watch 12 11 10,iPad 9 8 Air,Airpods 5 4
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Start with a symptom-to-layer map

Use the symptom to choose the first check, but confirm the result in the logs rather than guessing.

What you see Most likely boundary First evidence to collect
Connection refused No process is accepting the destination address and port, or a local policy is rejecting it Listening sockets, service status, firewall and security-group rules
Timeout Traffic is being dropped or routed to the wrong endpoint DNS result, public IP, firewall/load-balancer path, then listening sockets
Nginx welcome page or another site The request reached Nginx but selected the default or wrong server block Loaded server_name, listen, default_server, and Host-header tests
404 from Nginx Wrong root, URI mapping, try_files, rewrite, or location rule Selected configuration, exact URI in the access log, filesystem path
502 or 504 The reverse-proxy path cannot reach or complete with the upstream Error log, proxy_pass target, DNS, port, and backend process
HTTPS warning or handshake failure Wrong TLS server block, unreadable certificate/key, DNS mismatch, or certificate problem Port 443 listener, certificate paths, DNS, browser and Nginx error details

1. Validate the configuration before every reload

Run the syntax test

Use the same privilege and installation that manages the service:

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

A successful test means Nginx can parse the configuration it was asked to load. It does not prove that the intended file is included, that a directory is readable at request time, or that an upstream is reachable. If the command names an include file, directive, permission problem, or syntax error, fix that exact file first. Do not keep reloading a configuration that has not passed the test.

Discover the active paths and build options

Different packages and source builds use different configuration and log locations. Ask the binary which paths it was compiled with:

nginx -V 2>&1

Inspect the output for --conf-path, --error-log-path, and, when you need diagnostic logging, --with-debug. A common Linux error log is /var/log/nginx/error.log, but the compiled path and service unit take precedence. If nginx -V appears to describe a different binary than the service uses, check the service unit’s ExecStart path and run the matching binary explicitly.

Print the fully expanded configuration

Includes and distribution-specific snippets can make the file you edited different from the configuration Nginx actually loads:

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

Search this output for every server { block, each listen, server_name, root, location, try_files, proxy_pass, and default_server. This is also the quickest way to detect a site file that exists on disk but is not enabled through the loaded include pattern.

2. Confirm the service and the real listening sockets

Check the service manager

On a system using systemd, inspect status and recent messages:

Rank #2
Sale
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter | USB C Dongle with 90W Max Power Delivery, 3×5Gbps USB A Data Ports, for MacBook, Dell, and More (Charger Not Included)
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
sudo systemctl status nginx --no-pager
sudo journalctl -u nginx -n 100 --no-pager

Other service managers use different commands, so identify the manager rather than assuming that a process named Nginx is the one serving requests. A failed reload can leave the previous, valid configuration running; the status output and journal show whether the new configuration was accepted.

Inspect sockets, not just processes

List TCP listeners and the owning process:

sudo ss -ltnp

Compare the observed address and port with the listen directives in nginx -T. A listener on 127.0.0.1:80 is not equivalent to one on the public interface. An IPv6-only listener is not equivalent to an IPv4 listener, and a service listening on port 8080 will not answer a request sent to port 80 unless another component forwards it.

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

Do not infer undocumented defaults from an omitted value. Nginx’s documented defaults for an omitted address or port depend on context and privileges; write the intended address and port explicitly when troubleshooting.

Check the path outside Nginx

Resolve the hostname from a client and compare the result with the machine you are inspecting. If DNS points to a load balancer, reverse proxy, CDN, or old server, a perfect local Nginx configuration will not change the public response. Check firewall rules, cloud security groups, and any front-end proxy for the same address and port. A refusal normally indicates that nothing is accepting the connection at that endpoint; a timeout more often indicates filtering or routing.

3. Prove which server block answers

Understand address, port, and Host matching

The listen directive chooses the address and port first. Nginx then uses the request’s Host header to select among server blocks that share that address and port. If no server_name matches, the request is handled by the default server for that listener. This is why an Nginx welcome page is useful evidence: it usually means the connection reached Nginx, but the intended server block was not selected or was not loaded.

Test locally with an explicit Host header

From the Nginx machine, send a request to loopback while naming the site you expect:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -I -H 'Host: example.com' http://127.0.0.1/

Also test the public address while preserving the Host header:

curl -I -H 'Host: example.com' http://PUBLIC_IP/

Replace the hostname and address with your values. A correct local response but a wrong public response points to DNS, a front-end proxy, firewalling, or a different destination. A wrong local response indicates Nginx configuration or server selection. Use curl -v when you need to see the connection address, request headers, redirects, and response headers.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter | 85W Max PD, 2 USB 3.0 & 1 USBC Data Ports, SD/TF Card Reader, for Laptops/Mac and Other Type C Devices (Charger Not Included)
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Look for duplicate and default listeners

In the expanded configuration, check for multiple blocks with the same address and port, an unintended default_server, a typo in the hostname, or a broad wildcard that captures the request first. Confirm that the requested spelling, including a www prefix if used, appears in the intended server_name. If both HTTP and HTTPS are configured, test each port separately; a correct HTTP block does not prove that the TLS block is correct.

4. Fix a static-file site

Verify the selected root and URI mapping

For a static site, start with the root in the server block that actually answers. A request for /assets/app.css normally maps beneath that root to a corresponding filesystem path, subject to the active location and rewrite rules. Check the exact path and case:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo ls -la /path/to/site
sudo find /path/to/site -maxdepth 2 -type f | head

Linux filesystems are case-sensitive. A file named Index.html is not the same as index.html. Verify that the configured index file exists and that a location rule is not replacing the expected path.

Check permissions along the whole path

The Nginx worker must be able to traverse every parent directory and read the requested file. Inspect ownership and mode bits:

namei -l /path/to/site/index.html
sudo -u nginx test -r /path/to/site/index.html && echo readable

The worker account may be named www-data, nginx, or another distribution-specific user. Use the account shown in the loaded user directive or service configuration. Mandatory access-control systems can also deny reads even when Unix permissions look correct; the error log will usually identify such a denial.

Review try_files and rewrites

A single-page application often needs a fallback such as try_files, while a conventional site may need a real file for every URI. A malformed fallback can turn valid routes into 404s or internal redirect loops. Inspect the active order of location blocks and rewrite directives, then request the failing URI directly and match it to the access-log entry. Make the smallest change in the intended server block, run nginx -t, and reload.

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

5. Fix a reverse-proxy site and 502/504 errors

Read the upstream error literally

When Nginx returns 502 or 504, treat the upstream path as the primary suspect until the error log shows otherwise. The proxy_pass directive forwards the request to a configured protocol, hostname, and port. The target must be reachable from the Nginx host, not merely from your laptop.

sudo ss -ltnp
getent hosts backend.example.internal
curl -v http://127.0.0.1:3000/health

Use the actual upstream hostname and port in the last command. If the backend listens only on a Unix socket, the proxy configuration must use the socket form supported by your setup rather than a TCP address.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray | Data transfer & Fast charging for MacBook, iPhone 17/16/15, iPad, Samsung Galaxy, Apple Watch
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Check protocol, port, and name resolution

An HTTP upstream and an HTTPS upstream are not interchangeable. Confirm that the scheme in proxy_pass matches what the backend speaks, that the port is open, and that DNS resolves from the Nginx machine. A name that resolves in an interactive shell can still fail under a restricted resolver configuration or container network. Test the exact name and address used by Nginx.

Confirm the location scope

Make sure proxy_pass is inside the intended location and that another more-specific location is not serving the request as a file. Trailing slashes can change how Nginx combines the location prefix and upstream URI, so compare the requested path with the backend’s access log. If the backend process is stopped, start or repair it first; if it is healthy locally but unreachable from Nginx, investigate bind addresses, network namespaces, firewall rules, and container bridges.

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

6. Watch access and error logs during one controlled request

Find the files actually in use

Nginx documentation describes logging as essential for troubleshooting traffic flow. The default Linux error-log path is often /var/log/nginx/error.log, but the exact location depends on the build and installation method. The access log can be set globally or inside a server or location block, so inspect the loaded access_log and error_log directives rather than assuming a filename.

Tail logs and make one request

In one terminal, follow the relevant files:

sudo tail -F /var/log/nginx/access.log /var/log/nginx/error.log

In a second terminal, issue one request with verbose output:

curl -v -H 'Host: example.com' http://127.0.0.1/

Match the timestamp, Host, URI, status, request length, and upstream message. The access log proves what Nginx returned; the error log explains why it could not complete the request. If no access entry appears, the request did not reach that Nginx instance or the request is being stopped before the configured log point.

Use status codes as evidence, not diagnoses

A 404 can be generated by Nginx or by an upstream application. A 500 can come from the backend even when Nginx is functioning. Inspect response headers and both logs to identify the component that produced the status. Record one failing request before changing configuration so you can verify whether the change altered the actual path.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

7. Interpret common failure branches

Connection refused

  1. Confirm the destination IP and port with a verbose client request.
  2. Check ss -ltnp for a listener on that exact address and port.
  3. Check service status and the journal for a failed start or reload.
  4. Check host firewall, cloud security-group, load-balancer, and reverse-proxy rules.
  5. If Nginx is proxying, separately test the upstream from the Nginx host.

A refusal means the TCP connection reached an endpoint that rejected it; it does not identify whether the endpoint was the intended server.

Timeout

Compare DNS answers from the client and the server’s public addresses. Confirm routing and firewall policy before editing Nginx. If a load balancer or CDN fronts the host, test the origin directly from an allowed network and inspect the front-end health check. Only after traffic reaches the machine should you debug listeners and server blocks.

Best Value
Sale
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display | 85W Max PD, 1 Powered USB-C 5Gbps & 2 Powered USB-A 3.0 5Gbps Data Ports, for MacBook Pro, MacBook Air, Dell and More (Black)
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Default Nginx page or another site

Inspect nginx -T for the intended include, duplicate listeners, a typo in server_name, and an unintended default_server. Repeat the explicit Host-header test. If the local request selects the right site but the public request does not, DNS or the front-end endpoint is selecting a different machine.

404

Verify the selected root, exact URI-to-file mapping, index file, try_files, and rewrites. Use the access log to capture the exact URI, including URL encoding and trailing slashes. Check whether the 404 response contains headers or a body identifying an upstream application rather than Nginx.

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

502 or 504

Read the error-log line for connection refusal, timeout, name-resolution failure, or protocol error. Verify the proxy_pass scheme, hostname, port, backend bind address, and process health from the Nginx host. A 504 generally means the connection or response did not complete within the relevant timeout; increasing timeouts before proving reachability can conceal a stopped or misaddressed backend.

8. Repair HTTPS separately from HTTP

HTTPS uses a different listener and commonly a different server block. Confirm that Nginx listens on the expected TLS address with a listen 443 ssl directive and that the request reaches the intended block. Check that the certificate and key paths in the loaded configuration exist and are readable by the Nginx master process. A certificate can be present while still being expired, issued for another hostname, or missing an intermediate certificate; use the browser’s exact certificate error and the Nginx error log to distinguish those cases.

Verify DNS before changing certificates. If the hostname resolves to another endpoint, you may be inspecting a valid certificate on the wrong machine. Test the origin locally only after selecting the correct TLS server block, and avoid disabling certificate verification as a permanent fix.

9. Escalate to debug logging only when normal logs are insufficient

Normal error and access logs should be your first evidence. Debug logging is more verbose and can expose request details, so enable it temporarily and restrict access to the resulting files.

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

Check whether the binary supports debug mode

nginx -V 2>&1 | grep -- --with-debug

If --with-debug is present, set an error_log directive to the debug level in the narrowest useful context, such as the affected server block, then validate and reload:

sudo nginx -t
sudo systemctl reload nginx

Debug logging can be enabled globally or for a particular server block. A more-specific error_log without the debug level overrides the parent setting and disables debugging in that context, so inspect nested blocks when no debug entries appear. Reproduce one request, collect the relevant lines, restore the normal level, validate again, and reload.

10. Choose the smallest safe fix

When two fixes seem possible, compare them on four questions:

  • Failure location: Is the problem at DNS/client reachability, the listener, server selection, static content, or the upstream?
  • Scope and reversibility: Can you change only the affected server block instead of a global include?
  • Reload versus restart: Can a configuration-only change be applied with a validated reload, or does the service need a restart because the process or package is unhealthy?
  • Observable evidence: Will the access and error logs show the intended request before and after the change?

Configuration edits normally require nginx -t followed by a reload. A restart interrupts workers and should be reserved for cases that require it, such as a failed service process or a package-level change. Keep a copy of the last known-good configuration and change one variable at a time.

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

End-to-end checklist

  1. Resolve the domain and confirm it points to the endpoint you are testing.
  2. Run sudo nginx -t and fix the exact reported file or directive.
  3. Run nginx -V to identify the binary, configuration path, log path, and debug support.
  4. Run sudo nginx -T and verify that the intended site file is loaded.
  5. Check service status and the journal for failed starts or reloads.
  6. Run sudo ss -ltnp and compare listeners with every relevant listen directive.
  7. Test loopback with an explicit Host header, then test the public IP with the same header.
  8. For static content, verify root, URI mapping, index files, ownership, permissions, and rewrite rules.
  9. For a proxy, test the exact upstream protocol, hostname, port, and health endpoint from the Nginx host.
  10. Tail the active access and error logs while making one controlled curl -v request.
  11. Handle HTTPS as its own listener and server-selection problem, including certificate readability and DNS.
  12. Enable debug logging only if the normal logs cannot identify the failing boundary, then turn it off after reproduction.

This sequence turns “Nginx is installed but my site will not load” into a bounded question: did the request arrive, which listener accepted it, which server block matched, and did that block successfully serve a file or reach its upstream?

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.