“Customize the NGINX server name” can mean three different jobs: routing a domain to a virtual server, changing what appears in HTTP responses, or replacing the literal NGINX product name in the binary. Use server_name for routing, --build with server_tokens build for an open-source build label, and a source edit followed by a rebuild for literal branding. These changes affect different outputs and should not be substituted for one another.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
First, define which “server name” you need to change
NGINX has several names that appear in different places. A domain in a server_name directive selects a virtual-server block. The product name and version shown in the HTTP Server header come from NGINX’s compiled metadata and token settings. Absolute redirects can use either the configured primary name or the request’s Host value. Treating all of these as one setting is the most common cause of an apparently ineffective change.
As an Amazon Associate I earn from qualifying purchases.
| Goal | Setting or change | What changes | Rebuild required | Rollback difficulty |
|---|---|---|---|---|
| Send a domain to a particular virtual host | server_name in the matching server {} block |
Virtual-server routing | No | Low: restore the configuration and reload |
| Show a custom label alongside the NGINX version | Compile with --build=NAME, then use server_tokens build |
Build metadata in supported response and error-page output | Yes, for the label | Moderate: retain the previous binary and configuration |
| Hide the NGINX version | server_tokens off |
Suppresses the version in error pages and the Server response header |
No | Low: change the directive and reload |
| Replace the literal NGINX product name | Edit src/core/nginx.h, then reconfigure, compile and install |
Compiled server name and version wherever the binary emits them, including protocol-facing locations and special pages | Yes | High unless the old binary is kept for immediate rollback |
| Make absolute redirects use the primary configured domain | server_name_in_redirect on |
Hostname used in absolute redirects | No | Low: restore the prior directive value and reload |
The rest of this guide keeps these cases separate so you can make the smallest safe change.
Use server_name to customize virtual-host routing
The directive that determines which virtual server handles a request is server_name. NGINX’s server-names documentation states that names are defined with this directive and determine which server block is used for a request. Matching supports exact names, wildcard names and regular expressions, with documented precedence rules; read the official server-names reference when overlapping patterns are involved.
#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.
Basic configuration
Open the active configuration file or an included file and place the domains in the intended server {} block:
server {
listen 80;
server_name example.org www.example.org;
location / {
proxy_pass http://127.0.0.1:8080;
}
}
After saving, test the exact configuration that the service will load, then reload NGINX:
nginx -t -c /path/to/nginx.conf
nginx -s reload
If your installation uses a non-default prefix or binary path, invoke that binary and pass the corresponding -p and -c options. A successful test confirms syntax and referenced files; it does not prove that DNS points to this server or that the upstream application is healthy.
How matching behaves
Use an exact name when one hostname should select the block. Wildcards cover a controlled family of names, while regular expressions should be reserved for cases that cannot be expressed with exact or wildcard names. When multiple blocks could match, NGINX applies its documented order rather than choosing the last block in the file. Check the server-names reference before adding a broad wildcard that could intercept traffic intended for a more specific host.
What this does not change
Changing server_name does not rename NGINX in the HTTP Server header, alter compiled branding, or automatically change every absolute redirect. Those outputs have separate controls described below.
Add an open-source build label with --build
If you want an internal build identifier such as Acme-Web-2026, attach it while compiling from source. The configure option records a build name; it does not replace the NGINX product name.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
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
1. Record the current build before changing it
- Save the running binary’s full path.
- Record the original configure arguments, installation prefix, service unit and active configuration file.
- Map the complete include tree so you know which file supplies each
http,serverandlocationsetting. - Keep the currently working binary and configuration available for rollback.
2. Reuse the original configure options
From the unpacked NGINX source directory, run the original configure command with the build label added:
./configure --build="Acme-Web-2026" [other options]
make
Replace [other options] with the options used by the existing installation, such as its prefix, modules and compiler flags. Omitting an option can silently produce a binary that lacks a module or uses a different file layout. The source-build procedure then installs the compiled result with make install; install to a staging prefix first when your service cannot tolerate an unverified replacement.
sudo make install
3. Expose the label with server_tokens build
Compiling a label does not by itself guarantee that clients will see it. In the http, server or location context, set:
http {
server_tokens build;
server {
listen 80;
server_name example.org;
}
}
server_tokens build adds the build name along with the NGINX version in the output controlled by this directive. Place the setting at the broadest context that should receive it, or override it in a narrower block when different virtual hosts need different behavior. The directive affects NGINX-generated response metadata and error-page output; it does not affect which server {} block receives a request.
Free tools Windows power users keep installed
One-click scans. No signup required.
4. Verify the new binary before switching traffic
Use the staged binary to inspect its version and build metadata, then test the configuration against that binary and prefix:
/staging/nginx/sbin/nginx -V
/staging/nginx/sbin/nginx -t -p /staging/nginx/ -c conf/nginx.conf
The exact command-line output depends on the build and installation paths. Confirm that the expected build label is present and that all dynamic modules and include files resolve before replacing the service binary.
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)
Hide the version without inventing a replacement name
Set server_tokens off when the objective is to reduce version disclosure:
http {
server_tokens off;
}
With this value, NGINX does not emit its version on generated error pages or in the Server response header. It does not create a custom product name, change virtual-host routing or rewrite arbitrary upstream headers. If an upstream application supplies its own Server header, that is a separate response-header problem and must be handled in the upstream or with an appropriate header-filtering configuration.
Why server_tokens string is not a general open-source solution
The HTTP core reference documents the directive forms on, off, build and string, but explicit string replacement is identified as a commercial-subscription feature from version 1.9.13. The current open-source source accepts on, off and build as its enum values. Therefore, do not deploy a configuration containing server_tokens string and assume that every open-source build supports it. On an open-source installation, use off, use a compiled build label with build, or perform the source-level change described next.
Replace the literal NGINX product name in an open-source build
When a requirement says that the binary must identify itself as another product, configuration alone is insufficient in the open-source path. An NGINX development ticket identifies src/core/nginx.h as the source location where the server name and version can be changed so the result propagates to client-facing protocol headers and the server name shown on special pages.
1. Patch the source under version control
Keep the change as a small, reviewable patch. Record the upstream NGINX version, your compiler toolchain, every configure argument and the exact old and new values. Do not edit only the installed binary: a later rebuild would erase an undocumented binary modification.
2. Re-run the original configure command
After editing src/core/nginx.h, repeat the same ./configure options used for the working installation. This preserves module selection, paths and compiler features while incorporating the source change.
Recommended Free Tools
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
./configure [the original options]
make
3. Install to a controlled staging path
Install the result somewhere the running service does not use, or package it so the switch is atomic:
make install
Use a staging prefix supplied to ./configure when necessary. Verify file ownership, permissions, linked libraries and module compatibility before changing the service’s executable path.
4. Verify protocol-facing output
Run the staged binary’s version command and a local request against a test listener. Check the response header and an NGINX-generated error page, because the source change is intended to propagate to both. Also test a normal proxied response so you can distinguish NGINX-generated metadata from headers supplied by the upstream application.
5. Switch and retain the old binary
Only after the staged checks pass should you update the service to use the new binary. Keep the prior executable, source patch and configuration in the same deployment record. A source-level branding change has a larger rollback surface than a configuration edit because the executable, modules and startup paths must all remain compatible.
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 →Control hostnames in absolute redirects
Changing the name used for redirects is separate from both routing and branding. With server_name_in_redirect enabled, NGINX uses the primary server_name in absolute redirects. With it disabled, NGINX uses the request’s Host header, or the server IP address when no Host header is present.
server {
listen 80;
server_name example.org www.example.org;
server_name_in_redirect on;
location / {
return 301 https://example.org$request_uri;
}
}
Review this setting when users report that redirects point to an unexpected alias or IP address. It does not change the Server header and does not alter the compiled name in the binary.
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.
Validate safely before reloading production
Use this sequence for either a configuration-only change or a new binary:
- Record the active executable, prefix, configure arguments and include files.
- Back up
nginx.conf, included configuration files and any source patch. - Choose the intended change:
server_namefor routing,--buildplusserver_tokens buildfor a build label,server_tokens offfor version suppression, or a source edit for literal branding. - Run
nginx -twith the production prefix and configuration file. Resolve every reported error before reloading. - For a rebuilt binary, test the staged executable with its own prefix and configuration, and verify modules and permissions.
- Reload only after the test succeeds, then make a request with an explicit
Hostheader for each affected domain. - Inspect the response status,
Locationheader on redirects,Serverheader where applicable and any generated error page.
curl -i -H 'Host: example.org' http://127.0.0.1/
A request sent to the server’s IP without the intended Host header may select a different default server, so test each hostname explicitly. For HTTPS, use the correct TLS name as well as the HTTP host when validating a production virtual server.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteTroubleshoot the common failure modes
The request reaches the wrong virtual host
- Check the request’s
Hostvalue and whether DNS points to the intended address. - Search every included file for duplicate or overlapping
server_nameentries. - Replace an overly broad wildcard or regular expression with an exact name where possible.
- Run
nginx -Twith the same prefix and configuration used by the service to inspect the complete loaded configuration.
The custom build label does not appear
- Confirm that the running executable is the rebuilt binary, not an older copy earlier in
PATH. - Check the binary’s version output for the expected build metadata.
- Verify that
server_tokens buildis in a loadedhttp,serverorlocationcontext and is not overridden by a narrower block. - Remember that an upstream response can supply its own headers; test an NGINX-generated error response as well as a proxied success response.
A configuration with server_tokens string fails
Remove the unsupported form from an open-source build. Choose off or build, or use the source-edit route if replacing the literal product name is a hard requirement.
Redirects use an alias or IP address
Inspect the primary name in the server_name list and the value of server_name_in_redirect. Also check whether the request arrived without a Host header or through a proxy that rewrites it.
The rebuilt service will not start
- Restore the previous binary and configuration immediately if the service is unavailable.
- Compare the new configure arguments, module set, library links, user and group permissions with the working installation.
- Run the staged binary’s configuration test directly rather than testing a different system-installed executable.
- Check service-manager paths and environment variables; a successful manual test does not prove that the service unit invokes the same binary.
Choose the least invasive option
For most deployments, start with server_name because it changes only request routing and requires a configuration reload. If an inventory or support system needs an identifiable build, compile a label with --build and expose it with server_tokens build. If the goal is simply to avoid advertising a version, use server_tokens off. Reserve the src/core/nginx.h edit for cases that genuinely require the product name itself to change, and treat that rebuild as a separately versioned software artifact with a tested rollback path.
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.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →

