Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

Why NGINX Shows the Welcome Page on www but Not the Bare Domain (and How to Fix It)

The NGINX welcome page on www usually means the Host header missed your intended server block. Diagnose DNS, listeners, TLS, and defaults step by step.
Length9 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If www.example.com displays the packaged NGINX welcome page while example.com serves your site, NGINX is usually handling the two hostnames with different server blocks. The apex request matches your configured server_name; the www request does not, so NGINX sends it to the default server for that listening address and port. That default server often still points to the distribution’s sample document root.

DNS can create the same symptom before NGINX gets involved. If the apex and www records resolve to different IPv4 or IPv6 addresses, they may reach different NGINX instances, proxies, or load balancers. The fix is to verify DNS, inspect the complete rendered NGINX configuration, then deliberately configure both names on HTTP and HTTPS.

As an Amazon Associate I earn from qualifying purchases.

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

What the symptom means

NGINX makes its virtual-host decision in two stages. First it accepts the connection on a particular listening address and port, such as port 80 for HTTP or port 443 for HTTPS. It then compares the request’s HTTP Host value (and, for TLS, the hostname supplied during certificate negotiation) with the server_name directives attached to that listener.

If the hostname matches, NGINX uses that server block’s root, proxy settings, redirects, and other directives. If no name matches, NGINX routes the request to the default server for that address and port. Unless a block explicitly uses default_server, the first server declared for that listener becomes the default. The welcome page is therefore evidence of a routing mismatch, not proof that your application files disappeared.

#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.
What you observe Most likely explanation What to check first
Apex works; www shows the welcome page www is absent, misspelled, or loaded in another listener server_name entries on ports 80 and 443
www works; apex shows the welcome page The reverse mismatch: the bare name does not match the intended block Exact spelling of the apex name and included files
Both names work over HTTP but not HTTPS The 443 blocks or certificate coverage differ from port 80 TLS listeners, SNI names, and certificate SANs
Results differ by network or device A and AAAA records lead to different endpoints IPv4 and IPv6 DNS answers and each destination

How NGINX chooses a server block

Exact, wildcard, and regular-expression names

The server_name directive accepts exact names, wildcard names, and regular expressions. NGINX’s documented priority is exact match first, then the longest leading wildcard (for example, *.example.com), then the longest trailing wildcard (for example, mail.*), followed by the first matching regular expression. An exact entry is the clearest choice for the apex and its public www alias.

This configuration makes both names use one site:

server {
    listen 80;
    server_name example.com www.example.com;
    root /var/www/example;
}

Putting both names on the same block does not merge DNS records and does not automatically configure HTTPS. It only tells NGINX that, once a request reaches this listener, both Host values should use the same configuration.

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

The default server belongs to a listener

default_server is a property of a listen address and port, not of a hostname. You can have one default for port 80 and a different default for port 443, and you can have different defaults on separate IP addresses. A request with an unknown Host header therefore may show one page on HTTP and another on HTTPS.

NGINX’s documentation describes the rule directly: when the Host value does not match any configured server name, or the request has no Host field, NGINX routes it to the default server for that port. The underscore often seen in catch-all examples has no special meaning; it is simply an invalid hostname commonly used as a label.

Check DNS before changing NGINX

DNS determines where a hostname connects. It is a separate layer from NGINX virtual-host matching, so inspect both names and both address families.

  1. Query IPv4 records:
    dig +short A example.com
    dig +short A www.example.com
  2. Query IPv6 records:
    dig +short AAAA example.com
    dig +short AAAA www.example.com
  3. Repeat from a resolver or network that reflects your users’ environment if the answers are geo-distributed or cached.

If the addresses differ, the requests may be reaching separate web servers, containers, load balancers, or CDN origins. Either point both names at the intended endpoint or configure equivalent virtual hosts on every destination. Do not assume that fixing the server receiving IPv4 also fixes an AAAA destination; browsers often prefer IPv6 when it is available.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.

Also check CNAME chains for www. A CNAME can ultimately resolve to a different service even when the visible DNS record looks related to the apex. DNS changes can remain cached for the record’s TTL, so test authoritative answers and public resolver answers when diagnosing a recent edit.

Compare the actual HTTP and HTTPS responses

Use headers to see whether the names return different status codes, redirects, or servers. Start without following redirects:

curl -I http://example.com
curl -I http://www.example.com
curl -I https://example.com
curl -I https://www.example.com

Record the status, every Location header, and whether the TLS certificate names include the hostname you requested. A 301 from one name may be intentional canonicalization; a 200 response containing the welcome page indicates that a server block is serving the sample root.

To bypass DNS and test a particular address while preserving the requested Host and TLS name, use --resolve:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -i --resolve www.example.com:80:203.0.113.10 http://www.example.com/
curl -i --resolve www.example.com:443:203.0.113.10 https://www.example.com/

Replace 203.0.113.10 with an address returned by DNS. The first command tests port 80 virtual-host matching at that address. The second tests the 443 listener, SNI, certificate selection, and HTTPS server block. If the direct test works but the normal hostname fails, DNS or an intermediate proxy is the problem. If both fail at the same address, inspect NGINX there.

Inspect the complete NGINX configuration

Looking at one site file is not enough. Distribution packages commonly load files through an include directive, and an enabled sample site may appear before your intended block.

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.
  1. Validate syntax and display the full rendered configuration:
    sudo nginx -t
    sudo nginx -T
  2. Search the output and included files for both hostnames:
    sudo nginx -T 2>/dev/null | grep -nE 'server_name|listen|default_server|root'
  3. Check every relevant listener. Look for listen 80, listen [::]:80, listen 443 ssl, and listen [::]:443 ssl. A name present on IPv4 but absent on IPv6 can produce apparently random results.
  4. Identify the block whose root points to the welcome-page directory. That block is commonly the default for port 80 or 443.
  5. Confirm that the file containing your fix is actually included or symlinked into the active configuration. Editing an unused file has no effect.

Pay attention to duplicate or conflicting declarations. Two blocks may contain similar names but listen on different addresses, ports, or protocols. A server_name on an HTTP block does not apply to the HTTPS block unless it is declared there too.

Choose the intended hostname policy

Serve both names as the same site

Use one block when both URLs are valid public entry points and you accept duplicate hostnames:

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.
server {
    listen 80;
    listen [::]:80;
    server_name example.com www.example.com;
    root /var/www/example;
    index index.html index.htm;
}

This is the simplest fix for identical content. Keep the IPv4 and IPv6 listeners aligned, and add the equivalent names to the TLS block as described below.

Redirect one name to a canonical URL

Choose a canonical hostname when you want one URL for bookmarks, analytics, cookies, and search indexing. Use a dedicated redirect block for the secondary name:

server {
    listen 80;
    listen [::]:80;
    server_name www.example.com;
    return 301 http://example.com$request_uri;
}

server {
    listen 80;
    listen [::]:80;
    server_name example.com;
    root /var/www/example;
}

For an HTTPS site, redirect the HTTPS version too. Do not redirect to HTTPS from a 443 block using a certificate that does not cover the incoming name; the browser validates the certificate before it can follow the HTTP response.

Approach Use when Operational consideration
One block with both exact names Both hostnames should render the same site Requires matching entries on every HTTP and HTTPS listener
Secondary-name 301 redirect You want one canonical URL Configure a redirect block and preserve $request_uri
Controlled catch-all Unknown names must not expose a sample site Define an intentional default for each address and port

Configure HTTPS and certificates separately

HTTPS introduces two additional checks: the TLS server block selected through SNI and the certificate presented before HTTP routing completes. A request can reach the correct IP yet receive the wrong content or a certificate warning if the 443 configuration does not include the requested hostname.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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

A basic shared-name TLS block looks like this:

server {
    listen 443 ssl;
    listen [::]:443 ssl;
    server_name example.com www.example.com;

    ssl_certificate     /etc/ssl/example/fullchain.pem;
    ssl_certificate_key /etc/ssl/example/privkey.pem;
    root /var/www/example;
}

The certificate must contain both names as valid subject-alternative names. If you use a canonical redirect, the certificate still needs to cover the redirected hostname because the browser connects to that hostname first.

Test each HTTPS name with curl -I and, when needed, inspect the negotiated certificate with a TLS client. A successful HTTP test does not establish that 443 has the same names, root, proxy target, or certificate.

Replace the exposed welcome-page default

Leaving a packaged sample site as the default can expose implementation details whenever someone requests an unknown hostname. After confirming that no required site depends on it, remove or disable the distribution’s sample default site and create an intentional catch-all.

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name _;
    return 444;
}

The 444 response is an NGINX-specific connection-close behavior. If dropping unknown requests is not appropriate, return a controlled 404 or redirect instead. Create equivalent defaults for 443 only when you have a deliberate TLS certificate and response strategy; an HTTPS catch-all still has to complete TLS before it can return an HTTP response.

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

Apply changes safely

  1. Save the configuration and run sudo nginx -t. Do not reload if syntax validation reports an error.
  2. Reload rather than stopping the service:
    sudo systemctl reload nginx

    Use the service manager appropriate to your operating system if it differs.

  3. Retest both names on HTTP and HTTPS, including an IPv4 and IPv6 path where available.
  4. Check the access and error logs for the request, selected upstream, certificate errors, or permission failures.

A reload applies the new configuration to workers without dropping established connections. If the response does not change, verify that you reloaded the NGINX instance actually receiving traffic; a container, reverse proxy, or load balancer may be terminating the connection elsewhere.

Common causes that survive an apparently correct edit

Typographical or incomplete names

www.example.com, wwww.example.com, and www.example.net are different names. Check punctuation, the correct top-level domain, and whether a trailing dot appears in generated configuration.

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.

Different IPv4 and IPv6 servers

An A record may point to the corrected host while an AAAA record still points to an old machine. Test with an IPv4-only and IPv6-only network, or use --resolve with each address.

Port mismatch

A name can be present on port 80 but absent on 443, or on one specific IP but not another. Review every listen line rather than searching only for the hostname.

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

Wrong certificate or SNI block

If the certificate does not list the requested hostname, fix certificate issuance and the 443 block before diagnosing page content. Browsers may stop at a certificate warning, while command-line clients can make the mismatch easier to see.

Proxy or load-balancer routing

When a front-end proxy terminates TLS or rewrites the Host header, the origin NGINX may never receive the hostname you tested. Confirm the front-end’s forwarding policy and configure every origin that can receive the request.

Stale configuration or cache

Run nginx -T after editing to verify the active result, reload only after nginx -t, and retest with headers. DNS caches and browser redirects can also preserve old behavior; compare with curl from a fresh environment.

A practical verification checklist

  • A and AAAA records for the apex and www resolve to the intended endpoints.
  • The intended server block lists both exact names, or a deliberate redirect block lists the secondary name.
  • Port 80 and port 443 configurations are checked independently.
  • IPv4 and IPv6 listen directives have equivalent names and defaults.
  • The TLS certificate covers every hostname users can enter.
  • The sample site is no longer an accidental default.
  • nginx -t succeeds before every reload.
  • Direct curl --resolve tests agree with normal DNS-based requests.

Once DNS reaches the intended endpoint and each listener has an explicit hostname policy, the welcome page stops being mysterious: it is simply the response from the server block that handled an unmatched name.

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.

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
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.