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

“Customize the NGINX server name” can mean three different changes. Use server_name when you need a domain to select a virtual server; compile with --build=NAME and enable server_tokens build when you want a build label exposed with the version; edit src/core/nginx.h and rebuild when you must replace the literal NGINX product name in the open-source binary. These changes affect different outputs and should not be treated as interchangeable.

Decide which “server name” you need to change

NGINX uses several names in separate parts of its operation. Choosing the wrong setting can leave routing unchanged, expose a different header than expected, or require a rebuild you did not need.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Goal Use What changes Rebuild required?
Send a domain to a particular virtual host server_name in a server {} block Virtual-server selection for requests No
Show an internal build label beside the NGINX version ./configure --build="NAME" plus server_tokens build Version/build information in supported NGINX output, including the Server header Yes, to add or change the label
Replace the literal NGINX product name emitted by the binary Edit src/core/nginx.h, then rebuild Product branding in protocol headers and special pages generated by the binary Yes
Make absolute redirects use one canonical host server_name_in_redirect Host name used in NGINX-generated absolute redirects No

The first option is a configuration change. The second attaches metadata to a source build. The third changes compiled source. The redirect directive is independent of all three.

Change virtual-host routing with server_name

Use server_name when requests for a domain should reach a particular server {} block. NGINX’s server-names guide states that names determine which server block is used and supports exact names, wildcards, and regular expressions: https://nginx.org/en/docs/http/server_names.html.

#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: 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.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.

Configure the name in the correct server block

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

    root /srv/www/example;
    index index.html;

    location / {
        try_files $uri $uri/ =404;
    }
}

Put every hostname that should share this virtual host on the same server_name line, separated by spaces. The listen directive still determines the address and port on which the block accepts connections; changing server_name does not create DNS records, open a firewall port, or provision a TLS certificate.

Understand matching precedence

When several server blocks listen on the same address and port, NGINX evaluates names according to its documented precedence. An exact name wins over wildcard names. Among wildcards, the longest matching wildcard is selected. Regular expressions are considered after the name-based wildcard checks, in configuration order. Keep overlapping patterns deliberate; a broad wildcard placed before a needed regular expression can produce an unexpected virtual host.

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

Add wildcard names carefully

server {
    listen 80;
    server_name *.example.org example.org;
}

server {
    listen 80;
    server_name api.example.org;
}

With these blocks, the exact api.example.org name is more specific than *.example.org. A wildcard does not automatically cover the bare parent domain, so include example.org explicitly when it must resolve to the same block.

Check the request path before blaming NGINX

  • Verify that DNS for the requested hostname points to the server being tested.
  • For HTTPS, ensure the certificate and TLS SNI configuration cover the same hostname; HTTP virtual-host matching cannot repair a certificate mismatch.
  • Confirm that the request includes the intended Host header. Testing an IP address without a host header normally selects the default server for that listening socket.

Validate and activate a server_name change

Always test the configuration that the running service will use, including its intended prefix and include files. A successful edit on disk does not mean the worker processes have loaded it.

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
  1. Back up the active configuration and identify the binary and prefix:
    command -v nginx
    nginx -V 2>&1

    Record the reported configure arguments, prefix, and configuration path before making changes.

  2. Edit the appropriate server {} block and save the file.
  3. Run a syntax and file-reference check. If the service uses a nondefault prefix or configuration file, specify both explicitly:
    nginx -t -p /usr/local/nginx -c conf/nginx.conf

    Use the same nginx binary and privileges that the service uses; otherwise you may validate a different installation.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  4. Reload only after the test succeeds:
    sudo nginx -s reload

    On systems managed by a service supervisor, use that supervisor’s reload action instead, such as sudo systemctl reload nginx.

  5. Verify routing with an explicit host header. Replace the address with the server under test:
    curl -i -H 'Host: example.org' http://203.0.113.10/

    For HTTPS testing against a specific address, use a tool and options that preserve the requested hostname and certificate verification behavior rather than testing only the IP.

    Rank #3
    Sale
    BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
    • 【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.

If nginx -t reports an error, do not reload. Fix missing semicolons, duplicate or malformed directives, unreadable certificate/key files, and incorrect include paths first.

Control the name used in absolute redirects

Routing and redirects are separate decisions. The server_name_in_redirect directive controls the host used in absolute redirects generated by NGINX. When it is enabled, NGINX uses the primary name from the relevant server_name directive. When it is disabled, NGINX uses the request’s Host header, or the server IP address when no Host header is present.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
server {
    listen 80;
    server_name example.org www.example.org;
    server_name_in_redirect on;

    location /old-path {
        return 301 /new-path;
    }
}

Place the directive in the http, server, or applicable context supported by your NGINX version. This setting does not alter the Server response header, virtual-host matching, or the compiled product name.

Add a custom build label during a source compilation

If the goal is to identify a particular binary rather than rename the software, add a build label at configure time. The source-build process uses ./configure to generate the build configuration, then compiles and installs with make.

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.

Configure, compile, and install with --build

cd /path/to/nginx-source
./configure --build="Acme-Web-2026" [other options]
make
sudo make install

Keep the original configure options when rebuilding an existing installation. They may specify modules, libraries, compiler flags, user and group settings, temporary directories, or a nondefault installation prefix. Omitting one can produce a binary that starts but behaves differently from the previous deployment.

Expose the label with server_tokens build

http {
    server_tokens build;

    server {
        listen 80;
        server_name example.org;
    }
}

server_tokens build is valid in http, server, and location contexts. On a build that supports this value, NGINX includes the configured build name together with the NGINX version in the relevant output. Scope it at http level when the behavior should be consistent across virtual hosts, or override it in a narrower context when only one site should expose the label.

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

Know what server_tokens does and does not do

Value Effect Availability and implication
on Emits the NGINX version on error pages and in the Server response header. Standard behavior; reveals more version detail.
off Suppresses the version on error pages and in the Server response header. Does not create a replacement product name.
build Adds the build label along with the NGINX version where supported. Requires a binary configured with --build=NAME.
string Replaces the emitted value with an explicit string. The HTTP core reference documents this as an NGINX commercial-subscription feature from version 1.9.13; do not assume it is available in an open-source build.

The current open-source source accepts on, off, and build as the relevant enum values. If server_tokens build fails configuration testing, inspect the version and build you actually installed instead of silently substituting an unsupported value.

Replace the literal NGINX branding in an open-source build

Configuration cannot replace the product name compiled into the open-source binary. For that requirement, change the branding definitions in src/core/nginx.h, then rebuild and install a separately identifiable binary. A development ticket identifies this file as the single source location whose values propagate to client-facing protocol headers and the server name shown on special pages.

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.

Use a controlled source patch

  1. Obtain the exact NGINX source version currently deployed and place it under version control.
  2. Save the running binary path, nginx -V output, configure arguments, active prefix, service unit, configuration tree, and module list.
  3. Back up the configuration and the unmodified source tree. Keep the branding change as a small, reviewable patch rather than editing an installed binary.
  4. Open src/core/nginx.h in the source release you are building. Identify the server-name and version definitions used by that release; do not assume symbol names or surrounding code are identical across versions.
  5. Change only the intended literal values, preserving valid C syntax and the version information needed for operational identification.
  6. Rerun the original ./configure command with the same options, then compile:
./configure [the original options]
make
  1. Install to a staging prefix first when possible. A separate prefix lets you test the new binary without replacing the known-good executable:
./configure --prefix=/opt/nginx-branded [the original options]
make
sudo make install
  1. Inspect the staged binary’s version/build output and start it against a copied configuration on a test port. Confirm the expected header and special-page behavior before changing the production service.
  2. Switch the service to the staged binary only after configuration validation, health checks, and a rollback plan are ready.

Branding changes can affect more than one response surface. Check normal responses, generated error pages, and any protocol output that exposes the compiled server name. Reverse proxies, CDNs, or downstream applications may independently rewrite or add headers, so inspect the response at the client boundary where the name matters.

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

Compare the four approaches before choosing one

Approach Primary output affected Rebuild Open-source status Rollback complexity
server_name Virtual-host routing No Open-source configuration directive Low: restore the configuration and reload
server_name_in_redirect Host in NGINX-generated absolute redirects No Open-source configuration directive Low: restore the directive and reload
--build + server_tokens build Build label and version in supported output Yes, to change the label build is available in supported open-source builds Moderate: switch binaries, then reload
Source edit in src/core/nginx.h Literal product branding in compiled output and special pages Yes Open-source path, maintained as a private patch Highest: preserve the prior binary, patch, and matching configuration

Do not use a source edit merely to route a domain, and do not expect server_name to change the Server header. Conversely, hiding the version with server_tokens off is not the same as replacing the product name.

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

A safe production sequence

  1. Inventory the deployment. Record the executable path, nginx -V output, configure arguments, service manager, prefix, active configuration file, and include tree.
  2. Classify the requirement. Choose routing, build identification, literal branding, or redirect canonicalization before editing anything.
  3. Back up. Save nginx.conf, included files, certificates and keys’ references, the source tree or patch, and the currently working binary.
  4. Make the smallest change. Edit only the relevant server block, directive, configure option, or source definition.
  5. Validate against the intended installation. Run nginx -t with the correct -p and -c values. For a rebuilt binary, test its own configuration and module set rather than the system copy.
  6. Stage rebuilt binaries. Install source changes under a separate prefix, verify metadata and responses, and retain the previous executable.
  7. Reload, do not restart unnecessarily. A reload lets NGINX validate and replace workers while preserving established service behavior; use the service manager’s documented action where applicable.
  8. Verify externally. Test the intended host header, redirect location, response headers, generated error pages, and HTTPS behavior from a client outside the local process.

Troubleshooting common outcomes

The request still reaches the wrong virtual host

  • Check the request’s Host header and the listening address/port.
  • Look for an exact name or longer wildcard in another server block that wins by precedence.
  • Confirm the edited file is included by the running configuration and that the reload succeeded.
  • Test DNS and, for HTTPS, SNI and certificate selection separately.

The Server header still says NGINX

server_name changes routing only. server_tokens off hides the version but does not supply a replacement product name. An open-source literal branding change requires the source edit and rebuilt binary described above; an upstream proxy may also be generating the header you are observing.

server_tokens build is rejected

  • Confirm that the running binary is the one rebuilt with --build=NAME, not a distribution package or older installation earlier in PATH.
  • Run the configuration test with that binary and inspect its version/build output.
  • Check the release’s supported directive values. Do not replace it with server_tokens string in an open-source build, because explicit string replacement is documented as commercial functionality.

The branded binary will not start

  • Compare its configure arguments, dynamic modules, library paths, user/group settings, and prefix with the previous binary.
  • Run its configuration test with absolute paths and inspect the error log.
  • Restore the prior executable and configuration if the failure affects service availability, then investigate the staged build offline.

Redirects use an unexpected hostname

Inspect server_name_in_redirect, the primary name ordering in the relevant server_name directive, and the incoming Host header. Remember that this directive affects NGINX-generated absolute redirects, not arbitrary redirect URLs explicitly written in application code.

Rollback and maintenance considerations

Keep the previous executable, its configure arguments, the unmodified source, and the last-known-good configuration together. A source-level branding patch must be reapplied whenever you upgrade to a new NGINX release; never assume the same source context or definitions exist unchanged. Rebuilds should be reproducible from a recorded command or build script, and the resulting binary should be clearly named or stored under a dedicated prefix so an operator cannot confuse it with the system installation.

Finally, treat branding as an operational choice, not a security control. Suppressing version text can reduce casual disclosure, but it does not patch vulnerabilities, alter request routing, or prevent fingerprinting through other behavior. Keep the actual NGINX version and build provenance available to administrators even when public responses expose less information.

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.