What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
To put app.example.com on an NGINX server, do four things in order: create DNS that points the hostname to the server, add an NGINX server block with an exact server_name, test and reload NGINX, and install a certificate for HTTPS. DNS only gets the request to your infrastructure; NGINX uses the request’s Host header to select the subdomain’s virtual server.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
The procedure below covers a static site and an application running on a local port, including DNS checks, configuration files, certificate issuance, and the failure modes that cause a subdomain to show the wrong site.
As an Amazon Associate I earn from qualifying purchases.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →What you need before configuring the subdomain
Have these details ready:
- Administrative access to the DNS zone for
example.com. - The public IPv4 address of the NGINX server, and its IPv6 address if you will publish an AAAA record.
- Shell access with permission to read and edit NGINX configuration and reload the service.
- The content directory for a static site, or the local address and port of the application you will proxy.
- Inbound firewall access for port 80 and, for HTTPS, port 443.
Replace app.example.com, the IP addresses, paths, and upstream port in the examples with your own values. A hostname must resolve correctly before NGINX or a certificate authority can serve it reliably.
1. Create DNS for the subdomain
Use an A, AAAA, or CNAME record
At your DNS provider, add an A record named app (which creates app.example.com) and set its value to the server’s public IPv4 address. If the server is reachable over IPv6, add an AAAA record with the IPv6 address. When the application is hosted on another platform, use that platform’s documented target; a CNAME is appropriate when the provider instructs you to alias the hostname.
#1 Best Overall
- BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
- EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
- COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
- LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
- WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.
Do not point the record at a private address such as 192.168.x.x for a public site. If your DNS provider uses a different field layout, the important result is the same: a lookup for the complete hostname must return the address or target that can serve the request.
Verify the record from the deployment environment
Check both the name and the record type from a machine that can reach the server:
dig +short app.example.com A
dig +short app.example.com AAAA
nslookup app.example.com
The answer may differ while nameservers update. Verify that the authoritative nameservers contain the new record and that the hostname is spelled exactly as it will appear in NGINX. A stale resolver cache can make one network see the old answer, so test from the server and from an external connection before diagnosing NGINX.
2. Create an NGINX server block
NGINX defines virtual servers with a server directive inside the http context. The server_name value determines which block handles a request after NGINX examines the listening address, port, and Host header. Use an exact name when this block is for one subdomain.
Static files
Create a document root and place the site files there:
Rank #2
- WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
- AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
- PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
- ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
- COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed
sudo mkdir -p /var/www/app
sudo chown -R www-data:www-data /var/www/app
The service account differs by distribution, so use the account your NGINX worker processes actually run as. A minimal HTTP block for static content is:
Free tools Windows power users keep installed
One-click scans. No signup required.
server {
listen 80;
listen [::]:80;
server_name app.example.com;
root /var/www/app;
index index.html;
}
The root directive maps a request path to a file below /var/www/app. The index directive tells NGINX which file to return for a directory request. Confirm that the index file exists and that NGINX can traverse every parent directory.
Reverse proxy to an application
If the site is generated by a process listening on a local port, keep the public hostname in NGINX and proxy requests to that process:
server {
listen 80;
listen [::]:80;
server_name app.example.com;
location / {
proxy_pass http://127.0.0.1:3000;
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;
}
}
Change 127.0.0.1:3000 to the address and port used by your application. The application must be running and listening there; NGINX cannot proxy to a process that has stopped or is bound to an inaccessible socket. Header requirements vary by framework, so preserve the headers your application needs for original host, client IP, and scheme handling.
3. Put the file in the active configuration
Save the block in the configuration directory used by your operating system. On distributions that use the sites-available/sites-enabled layout, a typical sequence is:
Rank #3
- Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
- Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
- Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
- ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
- Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)
sudo nano /etc/nginx/sites-available/app.example.com
sudo ln -s /etc/nginx/sites-available/app.example.com /etc/nginx/sites-enabled/app.example.com
If your distribution loads files from a different directory, follow that layout instead of creating a link that NGINX never reads. Check the main configuration’s include directives to see which files are active. Remove or disable duplicate blocks for the same hostname; two definitions can make troubleshooting misleading.
4. Test the configuration and reload NGINX
Always test before reloading. The test must finish successfully; a reload should not be treated as proof that the new host works.
- Check syntax and referenced files:
sudo nginx -tLook for the explicit successful-test message. Errors identify the file and line that must be corrected.
- Inspect the effective configuration when necessary:
sudo nginx -TThis prints the loaded configuration, which helps find an unexpected wildcard or duplicate
server_name. - Reload through the operating system’s service manager:
sudo systemctl reload nginxUse the equivalent command when your system uses another service manager.
- Check service state and logs:
sudo systemctl status nginx sudo journalctl -u nginx --since "10 minutes ago"Confirm that the reload completed and that no permission, bind, or upstream errors appeared.
Test the hostname itself rather than only the server’s IP address. A request made to the IP can select a different default server because it carries a different Host header.
How NGINX chooses the subdomain’s server block
For an incoming request, NGINX first considers the listening address and port. It then compares the Host header with the server_name values on the matching listeners. An exact name such as app.example.com is the clearest choice for one host. Wildcard names such as *.example.com cover multiple names, while regular expressions handle advanced patterns.
Recommended Free Tools
Matching priority matters when several blocks could accept a request. An exact name should not be accidentally shadowed by a broad wildcard or by an older default block. Review all enabled files if the main site appears at the new hostname. DNS wildcard records and TLS wildcard certificates are separate features: one controls name resolution and the other controls which names a certificate covers.
Rank #4
- Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
- Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
- 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
- Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
- USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC
Static hosting versus reverse proxying
| Approach | NGINX directives | What must be available | Typical failure |
|---|---|---|---|
| Static files | root and index |
Readable files and executable (traversable) parent directories | 404 when the path or index file is wrong |
| Reverse proxy | location / and proxy_pass |
A running application listening at the configured address | 502 when NGINX cannot connect upstream |
Do not configure both models unintentionally. A static root does not make a separate application reachable, and a proxy block does not serve files from that directory unless you add a separate location with a deliberate design.
5. Add HTTPS for the exact hostname
Prepare DNS and port 80 for validation
Obtain a certificate that covers app.example.com. For an HTTP-01 challenge, the hostname must resolve to the validation server, port 80 must be reachable, and the challenge path under /.well-known/acme-challenge/ must be served rather than blocked or redirected incorrectly. Keep a port-80 listener available for this purpose even after enabling HTTPS.
Before changing the configuration with an automated tool, back up the NGINX files. Certificate clients can install a certificate and modify supported web-server configuration, but you remain responsible for checking the resulting files and testing the service.
Use Certbot’s NGINX integration
Run Certbot for the exact hostname using the package and command appropriate to your operating system. The integration can request a certificate and update a supported NGINX configuration. After it finishes, inspect the certificate paths it reports, run nginx -t, reload NGINX, and open the HTTPS URL. Do not claim that renewal works until you have run a renewal test and reviewed its result.
Configure a 443 server block manually
A TLS virtual server includes the certificate and private-key files:
Best Value
- Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
- Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
- Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
- Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
- Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name app.example.com;
ssl_certificate /etc/letsencrypt/live/app.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/app.example.com/privkey.pem;
root /var/www/app;
index index.html;
}
For a proxied application, retain the location / and its upstream settings in this 443 block instead of the static root. The certificate’s subject alternative names must include the exact hostname. Install the full chain in ssl_certificate and protect the private key from unauthorized reads.
NGINX’s HTTPS guidance uses TLS 1.2 and TLS 1.3 in its example defaults. Avoid disabling protocols or changing cipher settings without a compatibility and security reason. After editing the TLS block, run sudo nginx -t and reload before testing https://app.example.com.
Redirect HTTP only after validation is working
Once the certificate and HTTPS endpoint work, you can make the port-80 block redirect ordinary requests:
server {
listen 80;
listen [::]:80;
server_name app.example.com;
location / {
return 301 https://$host$request_uri;
}
}
When using HTTP-01 renewal, make sure the challenge location remains reachable. A blanket redirect is often followed correctly, but a custom rule that blocks or rewrites the challenge path can still cause issuance or renewal failures.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Exact names, wildcards, and certificates
| Decision | Best fit | Important consequence |
|---|---|---|
Exact server_name |
One known hostname such as app.example.com |
Least ambiguous routing and the easiest configuration to audit |
Wildcard server_name |
Several subdomains sharing behavior | Every covered name still needs DNS that reaches the server or service |
| Individual certificate | A small, explicit set of hostnames | Request and renew each covered hostname as required |
| Wildcard certificate | Many names under one DNS suffix | Certificate coverage does not create DNS records or NGINX routing |
Use a wildcard only when the shared routing and certificate policy are intentional. A wildcard DNS record and wildcard certificate do not automatically configure one another.
Troubleshooting by symptom
The DNS lookup fails
- Confirm the A, AAAA, or CNAME value and the authoritative nameservers for the zone.
- Check that the hostname is spelled exactly as in
server_name. - Query from the deployment server and an external network to distinguish propagation or resolver caching from an incorrect record.
The main site appears instead
- Confirm the browser request is to
app.example.com, not the server IP or the parent domain. - Inspect enabled files for duplicate, wildcard, or default
server_nameentries. - Verify that the block listens on the address and port receiving the request.
- Run
nginx -Tto confirm the intended block is actually loaded, then reload after corrections.
The new host returns 404
- For static content, check the
rootpath, the requested filename, and theindexfile. - Check file ownership and directory traversal permissions for the NGINX worker account.
- For a proxy, make sure the request reaches the intended
locationand is not being handled by a static block or another server.
The new host returns 502 Bad Gateway
- Confirm that the upstream process is running and listening at the exact address and port in
proxy_pass. - Test the upstream locally from the server with an appropriate HTTP client.
- Check local firewall rules, Unix-socket permissions, and the NGINX error log.
- Review whether the application binds only to a different interface or uses a different port after restart.
The browser reports a certificate warning
- Inspect the certificate’s subject alternative names and verify that
app.example.comis covered. - Check that the 443 block uses the matching
ssl_certificateandssl_certificate_keyfiles. - Use the full-chain file where required, not only the leaf certificate.
- Confirm that the request is reaching the intended 443 server block rather than a default certificate.
ACME HTTP-01 validation fails
- Resolve the hostname and confirm it points to the server that will answer the challenge.
- Allow inbound port 80 and verify that the challenge path is not denied by NGINX, a redirect rule, or another proxy.
- Check the port-80 access and error logs while repeating the validation.
- After fixing DNS or routing, rerun the certificate command and then test NGINX before reloading.
Operational checklist
- Create the correct DNS record and verify it resolves from the server and an external network.
- Choose static serving or reverse proxying; do not leave an obsolete example block enabled.
- Set an exact
server_namefor the hostname unless a deliberate wildcard design is required. - Enable the configuration using the layout your operating system actually loads.
- Run
nginx -t, inspect errors, and reload only after a successful test. - Confirm HTTP routing with the hostname and inspect logs if the wrong site appears.
- Issue a certificate for the exact hostname, keeping port 80 reachable for HTTP-01 validation when used.
- Configure the 443 block, test the certificate and chain, and reload NGINX.
- Run a renewal test before relying on automated renewal.
With DNS resolving to the right infrastructure and an active NGINX block whose server_name matches the Host header, the subdomain has independent content or proxy behavior. HTTPS then adds a certificate and key that explicitly cover that hostname; it does not replace the DNS or virtual-server configuration.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Quick Recap
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.




