To put app.example.com on one VPS, complete two separate configurations: create a DNS record that sends the hostname to the VPS, then add an Nginx server block that decides which site or application answers. Open TCP ports 80 and 443, keep application ports private, issue a certificate for the exact hostname, and test both HTTP redirection and HTTPS. One public IP can serve many subdomains because Nginx uses the requested hostname and TLS SNI to select the right configuration.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
How the pieces fit together
A subdomain is not created by Nginx alone. DNS and web-server routing perform different jobs:
As an Amazon Associate I earn from qualifying purchases.
Free tools Windows power users keep installed
One-click scans. No signup required.
- DNS: translates
app.example.cominto the VPS’s public IPv4 or IPv6 address, or aliases it to another hostname. - Nginx: receives the connection on the VPS and matches the hostname against
server_name. It can serve files directly or proxy the request to an application listening on a private port. - TLS: supplies a certificate for the exact hostname and encrypts traffic on port 443. SNI lets several HTTPS names share one IP address.
Cloudflare’s subdomain documentation, updated April 16, 2026, states that a hosting provider must first be able to serve the requested hostname, such as <subdomain>.example.com. A DNS record by itself does not create a website or make an application listen for that name.
Plan the hostname and application target
Decide the names and local destinations before changing DNS. For example, you might use:
#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.
| Hostname | Purpose | Nginx destination |
|---|---|---|
app.example.com |
Web application | 127.0.0.1:3000 |
api.example.com |
API service | 127.0.0.1:8080 |
blog.example.com |
Static files | A local document root such as /var/www/blog |
Write down the exact spelling of every hostname. Certificates, Nginx matching, browser requests, and DNS records all depend on that spelling. Decide whether each service is static or proxied, and verify that a proxied application will listen on the address and port you intend to use.
Create the DNS record
Use the DNS control panel at the authoritative provider for example.com. The record name is normally only the label, not the complete hostname.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →| Record | Name | Value | Use it when |
|---|---|---|---|
| A | app |
203.0.113.10 |
The VPS has this public IPv4 address. |
| AAAA | app |
Your VPS’s IPv6 address | IPv6 is configured end to end and reaches the same Nginx service. |
| CNAME | app |
A target hostname | The subdomain should alias another hostname rather than point directly to an IP. |
For the example, an A record may appear as A app 203.0.113.10. Replace the documentation address with the VPS address assigned to you. Add an AAAA record only after testing that IPv6 traffic reaches this VPS, its firewall, and the intended Nginx listener. An unreachable or misrouted AAAA record can make some clients and certificate validators choose a broken IPv6 path even though IPv4 works.
Do not create several conflicting A or AAAA records unless you deliberately operate several working endpoints. During setup, check for old records at the authoritative nameservers; a stale address is a common reason a browser reaches the wrong server.
Open the public network path
Permit inbound TCP 80 and TCP 443 in both layers that can filter traffic: the VPS operating-system firewall and any firewall supplied by the VPS provider. Port 80 is needed for ordinary HTTP and for the HTTP-01 certificate challenge; port 443 carries HTTPS.
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
Keep application ports such as 3000 and 8080 private when Nginx is the public entry point. Bind applications to loopback (127.0.0.1) where possible, or restrict their firewall rules to the VPS itself. Exposing every development port creates an avoidable attack surface and bypasses the hostname routing, logging, and TLS policy in Nginx.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsConfirm that Nginx will listen on both address families you publish. If you advertise IPv6 but Nginx, the firewall, or the provider does not route IPv6 correctly, remove the AAAA record until the path is fixed.
Install an Nginx server block for a subdomain
Nginx chooses a server block by comparing the requested hostname with server_name. Each subdomain should have its own block, a distinct name, and either a document root or an upstream destination.
Static content
Create the document root and place the site’s files there. A minimal block for blog.example.com is:
server {
listen 80;
listen [::]:80;
server_name blog.example.com;
root /var/www/blog;
index index.html;
location / {
try_files $uri $uri/ =404;
}
}
The try_files directive checks for a matching file or directory and returns a 404 when neither exists. Ensure the Nginx worker can read the document root and that the path contains the expected index.html or other entry file.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
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)
Reverse proxy to an application
For app.example.com forwarding to a service on loopback port 3000, use:
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;
}
}
NGINX’s web-server guide documents proxy_pass for forwarding requests. The application must actually be running and listening on the address and port in that directive. A process listening only on a different interface, a stopped service, or a typo in the port will produce a 502 response.
Enable and validate the configuration
- Save the block in the distribution’s Nginx configuration directory, commonly under
/etc/nginx/sites-available/or an equivalent included directory. - Enable it using the mechanism used by your operating system, often a symbolic link into
sites-enabled. - Run
sudo nginx -t. Do not reload while this test reports a syntax or include-file error. - After a successful test, reload Nginx with your system’s service manager, for example
sudo systemctl reload nginx. - Check the active configuration if the wrong site appears. A different server block may be selected first, or the requested hostname may be absent from
server_name.
Keep a copy of the last known-good configuration. A failed syntax test should be corrected and retested before any reload; a successful test confirms syntax and file inclusion, not that the upstream application is healthy.
Confirm DNS before requesting a certificate
Query the public DNS view for the exact name:
dig +short app.example.com
The result should contain the VPS’s intended IPv4 address. If you published IPv6, query it as well and verify that it is the address on this VPS. DNS changes can be cached, so a local resolver may temporarily return an older value; authoritative nameservers and multiple external resolvers are useful when diagnosing propagation.
When the name resolves correctly, request http://app.example.com and confirm that Nginx answers. If a certificate challenge later fails, you can inspect the HTTP-01 path, including a temporary request to /.well-known/, while troubleshooting. The challenge must be able to make a direct connection to port 80; a DNS record that points somewhere else, a closed firewall, or a proxy mode that does not pass the request can prevent validation.
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
Issue and install HTTPS
Use an ACME client such as Certbot or another client supported by your operating system. Request a certificate for the exact hostname, for example app.example.com, after DNS and port 80 are working. The client proves control of the name, obtains the certificate, and should be configured to renew it automatically.
Certbot can edit an Nginx configuration, add an HTTPS server block and HTTP-to-HTTPS redirect, then reload Nginx. Review the changes rather than assuming every existing rule is appropriate. If you manage the block yourself, the HTTPS portion follows this pattern:
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name app.example.com;
ssl_certificate /path/to/fullchain.pem;
ssl_certificate_key /path/to/privkey.pem;
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;
}
}
server {
listen 80;
listen [::]:80;
server_name app.example.com;
return 301 https://$host$request_uri;
}
Use the certificate and key paths supplied by your ACME client, not the illustrative paths above. Protect the private key, keep renewal enabled, and reload Nginx after a renewed certificate is installed. Port 443 must be reachable from the public internet for browsers to establish HTTPS.
For several names on one address, obtain coverage for each hostname or use a certificate that explicitly includes the names. NGINX describes TLS Server Name Indication (SNI) as a generic solution that lets a browser pass the requested server name during the SSL handshake, allowing several HTTPS servers to share one IP.
Verify the finished subdomain
- Run
dig +short app.example.comand confirm the expected address or addresses. - Open
http://app.example.com. It should either show the intended HTTP response during setup or return a 301/308 redirect to HTTPS after the redirect is enabled. - Open
https://app.example.comand inspect the certificate hostname, expiration, and issuing chain in the browser. - Confirm that the response comes from the correct static root or application. A 200 response from the wrong site still indicates a hostname-matching problem.
- Review Nginx access and error logs while making a request. Logs reveal the requested host, status code, upstream failure, and the file or proxy path Nginx selected.
- Test from an IPv6-capable network if an AAAA record exists. Remove or correct AAAA before relying on the name if IPv6 fails while IPv4 succeeds.
Repeat these checks after adding every new subdomain. Each name needs a DNS record, a matching Nginx block, certificate coverage, and a reachable application or document root.
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.
Add more subdomains to the same VPS
There is no requirement for one VPS or one public IP per subdomain. Repeat the same four-part pattern:
| Layer | app.example.com |
api.example.com |
|---|---|---|
| DNS | A record to the VPS IPv4 address | A record to the same VPS IPv4 address |
| Hostname match | server_name app.example.com |
server_name api.example.com |
| Local target | 127.0.0.1:3000 |
127.0.0.1:8080 |
| TLS | Certificate containing app.example.com |
Certificate containing api.example.com |
Use a separate server block and upstream port where the applications are different. A request for api.example.com reaches the same IP as app.example.com, but Nginx’s hostname match sends it to the API block. Keep names explicit instead of relying on a broad default block that could accidentally serve the wrong application.
Diagnose common failures
DNS returns the wrong address
- Query the authoritative nameservers and compare the result with the VPS address.
- Check that the record name is
app, not a duplicated full name such asapp.example.com.example.comin providers that automatically append the zone. - Remove stale or conflicting A and AAAA records.
- Confirm that the domain’s delegated nameservers are the ones where you made the change.
The certificate challenge fails
- Verify that TCP 80 is open in both VPS and provider firewalls.
- Request the hostname directly over HTTP and check that Nginx answers it.
- Check whether a proxy or CDN mode is intercepting the challenge instead of forwarding it to this VPS.
- Test the IPv6 address if an AAAA record exists. An unreachable IPv6 path can cause validation trouble even when IPv4 is healthy.
- Confirm that the certificate request uses the exact hostname in
server_nameand DNS.
Browser shows 502 Bad Gateway
A 502 usually means Nginx could not obtain a valid response from the configured upstream. Confirm that the application is running, listening on 127.0.0.1:3000 (or the chosen port), and not bound only to an unrelated address. Compare the live configuration with proxy_pass, then inspect the Nginx error log for connection-refused, timeout, or upstream-reset details.
The default site appears
The request may be matching another server block first, or the hostname may be missing or misspelled in server_name. Check that the intended file is enabled, run nginx -t, reload Nginx, and remove or disable an unwanted default block where appropriate. Test with the real hostname rather than an IP address; an IP-only request does not supply the same host match.
HTTPS shows a warning
Inspect the certificate presented by the server. The warning can mean the certificate does not contain the exact hostname, has expired, or the browser reached a different IP than the server where you installed the certificate. Compare DNS A and AAAA results with the VPS addresses, verify the 443 block’s certificate paths, and reload Nginx after correcting them.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Operational safeguards
- Separate public and private ports: expose 80 and 443 through Nginx, while keeping application listeners private.
- Validate before reload: always run
nginx -t; a syntax error should never replace a working configuration. - Keep certificate renewal observable: ensure the ACME client’s scheduled renewal runs and that Nginx reloads after a successful renewal.
- Monitor both address families: an AAAA record is a commitment to serve IPv6, not merely an additional DNS value.
- Use logs during changes: access logs confirm hostname and status; error logs distinguish routing, file, and upstream failures.
- Back up configuration: retain known-good Nginx blocks and record which local port belongs to each subdomain.
When a different implementation may fit
Nginx is the implementation shown here because it makes DNS-to-hostname-to-upstream routing explicit. If you evaluate a different web server or a control panel, compare the same operational questions rather than choosing by branding:
| Question | What to verify |
|---|---|
| Certificates | Does it issue and renew ACME certificates automatically, and can you inspect the resulting configuration? |
| Routing | Can it match hostnames and reverse-proxy each subdomain to a separate local port? |
| Transparency | Can you review, back up, test, and roll back generated configuration? |
| Networking | Does it clearly handle firewall rules, port 80 validation, HTTPS on 443, and IPv6? |
| Operations | What additional services, updates, and monitoring will it require on the VPS? |
Regardless of the tool, the underlying sequence remains the same: publish a correct hostname, make the network path reachable, route that hostname to the intended content, issue a matching certificate, and verify every address family you advertise.
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.

