Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk8 min

How to Customize the Nginx Server Name After Compiling from Source

A practical guide to the four meanings of “NGINX server name”: virtual-host routing with server_name, build labels with --build and server_tokens build, version hiding, redirect hostnames, and source-level branding via src/core/nginx.h.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The correct change depends on what you mean by “server name.” Use server_name when you need a domain to select a virtual server block; compile with --build and enable server_tokens build when you want a visible build label; edit src/core/nginx.h and rebuild when you must replace the literal NGINX product name. These changes affect different outputs and should not be treated as interchangeable.

Choose the kind of name you want to change

NGINX uses several independent names. A domain in a server_name directive controls virtual-host routing. A build label is metadata attached when the binary is compiled. The product name shown by the binary and on special pages is source-level branding. Redirect hostnames are controlled separately by server_name_in_redirect.

As an Amazon Associate I earn from qualifying purchases.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Goal Primary setting or file What changes Rebuild required Licensing and rollback
Route a domain to a virtual server server_name in the relevant server {} block Selection of the server block for a request No Open-source configuration change; restore the previous configuration
Attach and expose a custom build label ./configure --build=NAME and server_tokens build Build name shown with the NGINX version where supported Yes, to change the label Open-source build option; retain the previous binary for rollback
Hide the NGINX version server_tokens off Suppresses the version on error pages and in the Server response header No Open-source configuration change; revert the directive to restore version output
Replace the literal NGINX product name src/core/nginx.h in the source tree Product name and version values propagated to client-facing protocol headers and special pages Yes Source edit in an open-source build; keep an untouched binary and patch for rollback
Use the configured primary name in absolute redirects server_name_in_redirect Hostname selected for absolute redirects No Open-source configuration change; revert the directive if redirect behavior is wrong

Decide which row describes your requirement before editing anything. Changing one row does not automatically change the others.

Change the name used for virtual-host routing

For requests that should reach a particular virtual server, edit the server_name directive in that server block. The NGINX server-names guide explains that server names determine which server block is used and supports exact names, wildcards, and regular expressions: NGINX server names documentation.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Basic configuration

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

    # locations and proxy settings
}

Place every hostname that should map to this virtual server in the directive. An exact name such as example.org is different from a wildcard or regular-expression pattern. NGINX applies documented matching precedence when more than one server block could match, so review all competing blocks rather than editing only the first one you find.

Safe editing procedure

  1. Record the active binary path, the configure arguments used for the existing build, and the configuration include tree. This prevents you from testing one configuration while the service reads another.
  2. Back up nginx.conf and any included files before changing the server block.
  3. Edit the server_name line in the block that listens on the required address and port.
  4. Check the complete configuration with nginx -t, using the intended prefix and configuration file when your installation has more than one instance.
  5. Reload the running service through your normal service manager only after the test succeeds. Keep the previous configuration available until requests have been checked.

What this does not change

server_name does not rename the NGINX software and does not replace the product name in the HTTP Server header. It only influences which virtual server handles a request. If your goal is a visible build or product label, use one of the build or source options below.

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

Add a custom label during a source build

The source-build configuration option --build=NAME attaches a build name to the compiled binary. A typical configure-and-install sequence is:

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
./configure --build="Acme-Web-2026" [other options]
make
sudo make install

Keep the other configure options from the existing installation. Replacing them accidentally can change modules, paths, or service behavior even though the build label itself is correct. The NGINX source-build instructions describe compilation and installation with make after configuration.

Expose the label with server_tokens build

On a current build that supports the build value, add the directive in the appropriate context:

http {
    server_tokens build;

    # server blocks
}

server_tokens build adds the build name along with the NGINX version. The directive is valid in http, server, and location contexts, so you can scope it more narrowly if different virtual servers require different behavior. Test the configuration before reloading.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Understand the visible result

The build label is metadata; it is not a replacement for the software name. It appears together with the NGINX version where NGINX emits that information. If clients must see a completely different product name rather than an additional build identifier, a source edit is required.

Hide the version without inventing a replacement name

Use server_tokens off when the requirement is simply to stop disclosing the NGINX version. The directive disables emitting the version on error pages and in the Server response header. It does not create a custom product name, and it does not alter virtual-host routing or redirect hostnames.

http {
    server_tokens off;
}

Because the setting can be placed in http, server, or location context, verify that inheritance and more-specific settings do not produce a result different from the one you intend. If you need a build label visible, use server_tokens build instead on a build that supports it.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Why server_tokens string is not a general open-source solution

The HTTP core reference describes the directive syntax as on, off, build, and string, but explicit string replacement is documented as a commercial-subscription feature from version 1.9.13. The current open-source source file accepts on, off, and build as enum values. Do not assume that an arbitrary value such as server_tokens "MyServer"; will work in an ordinary open-source build; it may fail configuration validation or require the commercial feature.

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

Replace the literal NGINX product name in an open-source build

If compliance, integration, or a controlled appliance requires the binary itself to emit a different product name, configuration alone is insufficient. An NGINX development ticket identifies src/core/nginx.h as the source location where the server name and version can be changed in one place, allowing the values to propagate to client-facing protocol headers and the server name shown on special pages.

Controlled source-edit workflow

  1. Record the currently running binary path, configure arguments, prefix, module choices, and active configuration include tree.
  2. Back up the source tree, or apply the branding change as a version-controlled patch. Keep the unmodified source available so you can reproduce the original binary.
  3. Edit the relevant server-name and version definitions in src/core/nginx.h. Treat this as a maintained source change: a future NGINX upgrade can modify the file or its surrounding definitions.
  4. Rerun ./configure with the same options used by the existing installation. Do not omit module, path, or feature flags merely because the branding edit is small.
  5. Compile with make and install the resulting binary to a staging or controlled path rather than overwriting the live binary immediately.
  6. Verify that the staged binary reports the expected build metadata and that its configuration passes nginx -t against the intended prefix and configuration file.
  7. Switch the service to the staged binary only after validation. Keep the previous binary, source patch, and configuration in a known rollback location.

Operational trade-offs

A source-level name change affects more output than a build label and therefore has a larger compatibility surface. Monitoring, support scripts, and clients that identify NGINX by its protocol banner may see the replacement value. Document the change and the exact source revision so an operator can distinguish an intentional branding change from an unexpected binary replacement.

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

Control hostnames in absolute redirects

Branding and routing do not determine which hostname NGINX places in an absolute redirect. Review server_name_in_redirect when redirects must use the configured primary name.

Enabled behavior

When server_name_in_redirect is enabled, absolute redirects use the primary server_name for the active server block. Define the desired canonical hostname first, then make that name the primary value in the directive.

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

Disabled behavior

When it is disabled, NGINX uses the request’s Host header for an absolute redirect. If no Host header is present, it uses the server IP address. This setting is independent of source-level branding and of the text emitted in the Server response header.

Recommended end-to-end sequence after a source compilation

  1. Inventory the running installation. Write down the binary path, configure arguments, prefix, active configuration file, and every included configuration directory.
  2. Choose one objective. Select server_name for virtual-host routing, --build plus server_tokens build for a build label, a source edit for literal branding, or server_name_in_redirect for redirect hostname selection.
  3. Protect rollback materials. Back up nginx.conf, included files, the source tree or patch, and the currently working binary.
  4. Make the smallest change. Avoid combining a branding edit with unrelated module, path, or proxy changes in the same build.
  5. Validate before activation. Run nginx -t against the exact prefix and configuration the service will use. A successful test of a different instance does not validate the live one.
  6. Stage source-built binaries. For --build or nginx.h changes, install to a controlled staging path and verify the expected metadata before changing the service’s binary path.
  7. Reload, then inspect behavior. Confirm that the intended virtual server receives requests, redirects use the expected host, and headers or error pages show only the information you chose to expose.
  8. Retain the previous state. Keep the prior binary and configuration until the new build has survived normal traffic and a rollback decision is no longer needed.

Troubleshooting by symptom

The request still reaches the old virtual server

  • Check that the edited block listens on the address and port receiving the request.
  • Review every competing server_name value, including wildcard and regular-expression names, because NGINX applies precedence rules when multiple blocks match.
  • Confirm that the service loaded the file you edited by testing and reloading with the intended prefix and configuration path.

The build label does not appear

  • Confirm that the binary was rebuilt with ./configure --build=NAME; changing the configuration alone cannot add metadata to an existing binary.
  • Check that server_tokens build is in a valid http, server, or location context and that a more-specific setting is not overriding it.
  • Verify that the running service points to the newly installed binary rather than the previous one.

An arbitrary replacement string fails configuration testing

The open-source build does not universally support server_tokens string. Use server_tokens off to hide the version, server_tokens build for a compiled build label, or the src/core/nginx.h source-edit route for literal product branding.

Redirects use an unexpected hostname

Inspect server_name_in_redirect. Enabled behavior uses the primary configured server_name; disabled behavior uses the request’s Host header, falling back to the server IP when no host header is present.

The source branding disappears after an upgrade

Source edits are not preserved automatically across a new source tree. Keep the change as a version-controlled patch, reapply it to the new revision, rebuild with the original configure options, and validate the staged binary before deployment.

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

What to document for future operators

  • The exact NGINX source revision and configure command used for the binary.
  • Whether the deployment changes routing, exposes a build label, hides the version, or replaces the product name.
  • The location of the source patch, previous binary, configuration backups, and rollback procedure.
  • The chosen primary server_name and the value of server_name_in_redirect when canonical redirects matter.
  • The validation command and the prefix/configuration path used during testing.

With that record, a future rebuild can reproduce the intended behavior instead of accidentally reverting to default metadata or changing virtual-host selection.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.