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 shows its welcome page or Gunicorn loads a different Django project, fix the two routing boundaries separately: make Nginx select the intended server block for the request’s host and port, then make that block proxy to the Gunicorn service that starts the correct Django module. Disable the packaged default site when it competes on the same port, verify the systemd unit’s working directory and virtual environment, test the configuration, and reload both services in that order.

Why the default page or wrong project appears

There are two independent decisions in this stack. Nginx first chooses a virtual server. It compares the address and port in the listen directive with the connection, then compares the HTTP Host header with each candidate’s server_name. If no name matches, Nginx sends the request to that port’s default server. When no block is marked default_server, the first loaded server for the port becomes the default. The Nginx documentation describes it this way: “If its value does not match any server name, or the request does not contain this header field, then nginx will route the request to the default server for this port.”

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

After choosing a server block, Nginx either serves a file from that block’s root or forwards the request through proxy_pass. A welcome page therefore usually means the request never reached your intended block, or that block still points at a default document root.

Gunicorn makes a second decision when it starts. Its application argument, working directory, Python executable, environment variables, and optional Python path determine which Django package is imported. The normal convention is gunicorn myproject.wsgi, run from the directory that contains manage.py. A service that starts from another directory, uses another virtual environment, or names another *.wsgi module can serve a perfectly healthy but entirely different project.

#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.

Map the running stack before changing it

Do not edit a guessed file. First inspect what Nginx and systemd actually loaded.

  1. Print the complete Nginx configuration, including files pulled in with include:
    sudo nginx -T
  2. List the distribution’s available and enabled site files. Debian- and Ubuntu-style installations commonly use these directories:
    ls -la /etc/nginx/sites-available/
    ls -la /etc/nginx/sites-enabled/
  3. Search the expanded configuration for every listener, server name, proxy target, and document root:
    sudo nginx -T | grep -E 'listen|server_name|proxy_pass|root|default_server'
  4. Identify the service that launches Gunicorn. The name may be a project-specific unit such as myproject.service or a template instance such as gunicorn@myproject.service:
    systemctl list-units --type=service | grep -i gunicorn
    sudo systemctl cat myproject.service
  5. Record the endpoint in the unit’s --bind option and compare it with the Nginx proxy_pass target. They must describe the same socket or the same TCP address and port.

The output of nginx -T is more reliable than looking at one file because an enabled symlink, an included fragment, or a distribution drop-in may change the effective configuration.

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

Make Nginx select your real domain

Declare every hostname you intend to serve

Edit the site file that is enabled for the public listener. A minimal HTTP block for a domain and its www alias looks like this:

server {
    listen 80;
    listen [::]:80;

    server_name example.com www.example.com;

    location / {
        proxy_pass http://127.0.0.1:8000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Replace the example names and endpoint with your values. If TLS is terminated by Nginx, make the equivalent changes in the HTTPS block that listens on port 443; changing only the port-80 block will not fix HTTPS traffic. Keep the exact spelling of the hostnames that DNS and users send. A request for www.example.com does not match a block that lists only example.com.

Understand IP-address tests

Opening http://203.0.113.10 sends an IP value in the Host header, not your domain. Unless that IP is listed in server_name, Nginx may correctly select the default server even though the domain works. Test the domain while connecting to the server’s address by supplying the intended host header:

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

For HTTPS, the TLS server-name indication also matters. Use the real domain in a browser or a curl request that resolves the domain to the target address; an IP-only HTTPS test can select a different certificate and server block.

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

Disable the packaged default site when it conflicts

Most Debian-family packages install a sample site, often enabled through /etc/nginx/sites-enabled/default. If it listens on the same address and port, it can win requests whose host name does not match your block, and it can become the first server loaded when no explicit default exists.

After confirming that your own site file is enabled, remove only the enabled link for the sample site, not an unrelated configuration:

sudo rm /etc/nginx/sites-enabled/default
sudo nginx -t
sudo systemctl reload nginx

Some teams prefer to retain a deliberate catch-all rather than have an arbitrary first block receive unknown hosts. In that case, mark your own block explicitly and return a clear response:

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

Use a redirect instead of return 444 if you intentionally want unmatched hosts sent to a canonical domain. The important point is that the catch-all must be a conscious choice, not the distribution’s welcome page.

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

Point proxy_pass at the exact Gunicorn endpoint

Nginx and Gunicorn can communicate through a Unix-domain socket or loopback TCP. Either works; a mismatch produces a 502 response even when Gunicorn itself is healthy.

Arrangement Gunicorn bind example Nginx upstream example Operational concerns
Unix socket --bind unix:/run/gunicorn/myproject.sock upstream django { server unix:/run/gunicorn/myproject.sock; } followed by proxy_pass http://django; The socket directory must exist at boot, and Nginx’s user must have permission to traverse the directory and open the socket.
Loopback TCP --bind 127.0.0.1:8000 proxy_pass http://127.0.0.1:8000; No socket-file permissions are involved, but the port must be free and the service must bind the same address Nginx uses.

A complete Unix-socket pattern is:

upstream django {
    server unix:/run/gunicorn/myproject.sock;
}

server {
    listen 80;
    server_name example.com www.example.com;

    location / {
        proxy_pass http://django;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Do not silently leave an old socket path in Nginx after renaming the project. Check the live endpoint with:

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.
sudo ss -lx | grep gunicorn
sudo ss -ltnp | grep 8000

The first command finds Unix sockets; the second finds TCP listeners. If the service uses socket activation, inspect the associated .socket unit as well as the .service unit so that the path is not created in one place and referenced differently in another.

Correct the systemd unit that starts Gunicorn

Open the unit shown by systemctl cat. Verify five values together: WorkingDirectory, the Python executable in ExecStart, the WSGI module, the service user and group, and the bind argument. A representative unit is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
[Unit]
Description=Gunicorn for myproject
After=network.target

[Service]
User=www-data
Group=www-data
WorkingDirectory=/srv/myproject
ExecStart=/srv/myproject/venv/bin/gunicorn --workers 3 --bind unix:/run/gunicorn/myproject.sock myproject.wsgi:application
Restart=on-failure

[Install]
WantedBy=multi-user.target

/srv/myproject must be the directory containing manage.py, unless you intentionally provide another import path. The virtual-environment executable should belong to the same environment where Django and the project’s dependencies are installed. The module in this example means a package named myproject with a wsgi.py file. Gunicorn also accepts the shorter myproject.wsgi form; use the form already supported by your project and keep the module name aligned with the package that contains settings.py.

If the project relies on an explicit settings module, add it in the unit’s environment or an environment file, for example:

Environment=DJANGO_SETTINGS_MODULE=myproject.settings

Use --pythonpath only when the project layout requires it. An unnecessary Python path can make Gunicorn import a second copy of a package elsewhere on the server, which looks like a wrong-project failure.

After editing a unit, make systemd reread it and restart the service:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.
sudo systemctl daemon-reload
sudo systemctl enable myproject.service
sudo systemctl restart myproject.service
sudo systemctl status myproject.service --no-pager

Do not assume that a successful restart means the intended application loaded. The status output and journal identify the command that ran and any import or settings errors.

Validate Gunicorn’s resolved configuration

Gunicorn provides two useful checks. Run them with the same virtual-environment executable and application module used by systemd:

/srv/myproject/venv/bin/gunicorn --print-config myproject.wsgi:application
/srv/myproject/venv/bin/gunicorn --check-config myproject.wsgi:application

--print-config displays the effective settings, including the bind value, worker settings, configuration file, and other options after defaults and files are applied. --check-config validates that the application can be configured without starting a long-running server. If either command imports the wrong package, fix WorkingDirectory, the module name, the virtual environment, or DJANGO_SETTINGS_MODULE before touching Nginx.

You can isolate the application from Nginx by temporarily running Gunicorn on a test loopback port as the deployment user:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
cd /srv/myproject
/srv/myproject/venv/bin/gunicorn --bind 127.0.0.1:8010 myproject.wsgi:application

In another shell, request that port:

curl -i http://127.0.0.1:8010/

Stop the temporary process after the test. If this direct response is the correct Django site, the remaining fault is in Nginx selection or proxying. If it is the wrong site, Nginx is not involved; repair the Gunicorn invocation.

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

Apply changes in a safe order

  1. Save the intended Nginx site file and confirm its symlink appears in sites-enabled or its equivalent include directory.
  2. Remove or deliberately replace the packaged default site if it shares the public listener.
  3. Check that the systemd unit’s working directory, executable, WSGI module, environment, and bind endpoint describe the intended project.
  4. Run sudo nginx -t. Do not reload if the test reports a syntax or include error.
  5. Reload Nginx without dropping established connections:
    sudo systemctl reload nginx
  6. Restart Gunicorn only after its unit is correct, then check status and recent logs:
    sudo systemctl restart myproject.service
    sudo journalctl -u myproject.service -n 100 --no-pager
  7. Test through Nginx using the real domain or an explicit host header:
    curl -i -H 'Host: example.com' http://127.0.0.1/

Reloading Nginx cannot repair an application that is not listening, and restarting Gunicorn cannot make Nginx choose a different virtual server. Keeping the checks in this order narrows the fault quickly.

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.

Keep static files from masquerading as the default site

Production deployments commonly let Nginx serve static files directly and send dynamic requests to Gunicorn. That is separate from application forwarding. A static location might look like:

location /static/ {
    alias /srv/myproject/staticfiles/;
}

location / {
    proxy_pass http://django;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
}

Use the actual directory produced by your Django static-file process. An incorrect root or alias can return files from a distribution document root, making CSS, JavaScript, or even an index page appear to belong to the default site. Confirm that the request is handled by the intended server block and that the filesystem path exists and is readable by Nginx.

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.

Do not place a broad root directive in a catch-all block and assume it will fall through to the proxy block. Once Nginx selects a server, its locations determine the response; another server’s proxy settings are not consulted.

Diagnose the common symptoms

Symptom Most likely boundary Checks and fix
Nginx welcome page or distribution index Nginx selected the packaged default server, or your site file is not included. Inspect nginx -T, compare listen and server_name, verify the enabled-site link, and remove or replace the default site.
The wrong Django project responds Gunicorn imported another module or started from another directory. Check ExecStart, WorkingDirectory, virtualenv path, DJANGO_SETTINGS_MODULE, and any --pythonpath. Run --print-config and a direct Gunicorn request.
502 Bad Gateway Nginx cannot connect to the Gunicorn endpoint. Check service status and logs, compare the bind argument with proxy_pass, verify the TCP port is listening, or verify socket existence and directory permissions.
Static files show a default page or wrong assets The selected server has the wrong root/alias, or another server block handled the request. Inspect the matching server and location in nginx -T; correct the static path and ensure the files are readable.
The domain works but the server IP shows the default The IP value in the Host header does not match the domain’s server_name. Use the domain for testing, send an explicit host header, or list the IP deliberately if that access path is required.
Changes seem ignored An old configuration is still loaded or the wrong unit was restarted. Use nginx -T, inspect enabled links, run systemctl cat for the active unit, then test and reload/restart the identified services.

Choose between a Unix socket and loopback TCP

Both endpoint types are valid, so choose based on the rest of your service management rather than mixing examples. A Unix socket avoids a listening TCP port and is common when Nginx and Gunicorn share a host. It adds filesystem ownership and directory-permission requirements. A loopback TCP bind is easier to inspect with standard socket tools and avoids stale socket files, but the port must remain unique and bound to the address Nginx uses.

  • Use a Unix socket when you already manage a dedicated runtime directory and can guarantee that the Nginx user can access it.
  • Use loopback TCP when several local services need simple port-based discovery or when socket-directory permissions are causing repeated failures.
  • Do not expose Gunicorn on a public interface merely to simplify Nginx configuration; bind to loopback unless another trusted component explicitly requires network access.

Whichever arrangement you choose, document the endpoint in one place and copy it exactly into the other. A path differing by one directory or a port differing by one digit is enough to produce a 502.

Final verification checklist

  • The intended Nginx file is included and enabled.
  • The public listen address and port are present in that file.
  • server_name contains the production domain and any required alias.
  • The packaged default site is disabled, or a deliberate catch-all is configured.
  • proxy_pass points to the exact socket or loopback port Gunicorn binds.
  • The systemd WorkingDirectory contains the intended project’s manage.py.
  • ExecStart uses the correct virtual environment and WSGI module.
  • User, group, runtime-directory, and socket permissions allow Nginx to connect.
  • nginx -t succeeds before every reload.
  • Gunicorn status and journal logs show a clean start.
  • A direct Gunicorn request returns the intended Django project.
  • A request through Nginx with the real host header returns that same project.

The reliable end state

A correct deployment has an unambiguous chain: the request’s host and port match one intentional Nginx server block; that block’s dynamic location forwards to one known Gunicorn socket or loopback port; and the systemd unit behind that endpoint starts the intended Django WSGI module from the directory containing the project. Once those three identities agree, disabling the sample site and reloading Nginx removes the default page without guesswork.

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.