DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk10 min

How to Run a Second WordPress Site on a Subdomain With Nginx

A practical guide to running a second WordPress site on an Nginx subdomain, including architecture choices, DNS, server blocks, PHP-FPM, HTTPS, verification and troubleshooting.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Yes. One Nginx server can host a second WordPress site at a subdomain such as second.example.com. The reliable setup has four separate pieces: DNS must point the hostname to the server, WordPress files must live in the intended document root, Nginx must select that hostname and pass PHP requests to PHP-FPM, and HTTPS plus WordPress URL settings must use the same subdomain.

Choose the architecture before editing anything. A separate WordPress installation gives the second site its own files, database, plugins, themes, updates and permissions. WordPress Multisite keeps several sites in one codebase and database network with shared administration. The steps below cover both choices, then show how to test and repair the failures that most often make a subdomain display the first site or return a 404.

As an Amazon Associate I earn from qualifying purchases.

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

Choose between a separate installation and Multisite

The hostname alone does not determine the architecture. Decide whether the sites should be operationally independent or managed as one WordPress network.

Use a separate WordPress installation when isolation matters

Create a new document root, database and database user for the subdomain when it needs its own plugin and theme set, an independent update schedule, different filesystem permissions or a separate backup and restore boundary. For example, the existing site might use /var/www/example.com, while the second site uses /var/www/second.example.com. Each installation has its own wp-config.php and writable uploads directory.

#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.

This arrangement limits a failed upgrade or compromised plugin to one site more effectively, but you must maintain two WordPress cores, two plugin inventories, two theme inventories and two backup jobs.

Use WordPress Multisite when the sites belong to one network

Multisite shares one WordPress codebase and network administration. A domain-based network can give each site a hostname such as site1.example.com and site2.example.com. Network administrators control themes, plugins and many settings centrally, while individual site administrators manage their own content.

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

Choose this model when shared governance and a common upgrade process are more important than filesystem and database isolation. A network-wide change can affect every site, and restoring one site independently is more involved because the database and codebase are shared. WordPress’s network-creation instructions require you to back up wp-config.php and the relevant rewrite configuration before applying generated settings.

Comparison

Decision factor Separate installation Multisite network
Code and database Distinct codebase, database and configuration Shared WordPress codebase and network database
Updates Scheduled independently for each site Core and network-level changes are shared
Plugins and themes Each site can choose its own set Network governance controls availability and activation
Backup and restore Simple per-site boundaries Network-wide backup is straightforward; single-site restoration needs extra planning
Hostnames Any hostname can map to its own Nginx block Domain-based sites use mapped hostnames; arbitrary future names need wildcard DNS
Operational effort More duplicated maintenance Central administration, with wider blast radius for mistakes

Prepare DNS, access and backups

Confirm the final hostname

Pick the exact name before creating files or certificates. This example uses second.example.com. The spelling, trailing-dot behavior in DNS tools and HTTPS hostname must remain consistent across DNS, Nginx and WordPress.

Back up the existing site

Save the current database, WordPress files and Nginx configuration. If you are converting or extending a Multisite network, make a separate copy of wp-config.php and the rewrite configuration before applying the network settings generated by WordPress. A backup lets you restore the known-good virtual host if a syntax error or URL change interrupts the first site.

Create the DNS record first

For a standalone subdomain, create an A record for second.example.com pointing to the server’s IPv4 address, or a CNAME pointing to a hostname that resolves there. If the server has IPv6, add the appropriate AAAA record as well. Wait until public DNS resolvers return the intended address before diagnosing Nginx; an Nginx change cannot fix a hostname that reaches another machine.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.

A domain-based Multisite network that lets administrators create arbitrary subdomain names needs a wildcard record such as *.example.com pointing to the server, in addition to any explicit records. A wildcard is not required merely because you have one fixed second site. DNS control-panel labels differ by provider, so verify the resulting record with a resolver rather than relying on the control panel’s status message.

Set up a separate WordPress installation

1. Create an isolated document root and database

Create a directory such as /var/www/second.example.com and ensure it is not the existing site’s root or a writable subdirectory shared by both installations. Create a new database and database user with only the privileges that installation needs. Record the database name, username, password and host for the installer.

Download WordPress into the new root using the normal package or your distribution’s documented method. Set ownership so the web server user can read the application and write only the directories that require it, normally wp-content/uploads and selected cache directories. Do not make the entire document root world-writable.

2. Add a dedicated Nginx server block

The following is the essential HTTP shape. Replace the document root and PHP-FPM socket with the paths used by your host:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
server {
    listen 80;
    server_name second.example.com;
    root /var/www/second.example.com;
    index index.php;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ .php$ {
        try_files $uri =404;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass unix:/run/php/php-fpm.sock;
    }
}

server_name is how Nginx chooses the virtual server for the request’s Host header. The root must contain the second site’s index.php. The front-controller fallback sends WordPress pretty-permalink requests to that file, while the PHP block prevents Nginx from passing a nonexistent script to PHP-FPM.

Socket names are distribution- and PHP-version-specific. A host may use a versioned path such as /run/php/php8.x-fpm.sock, a TCP address, or a provider-specific location. Use the socket belonging to the PHP-FPM service that serves this site, not a path copied from another server.

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

3. Test and reload without losing the working configuration

Run the Nginx configuration test supplied by your platform, commonly nginx -t. Fix every syntax error, missing include, duplicate listener or invalid certificate path before reloading. Then reload the service using the platform’s service manager, commonly systemctl reload nginx. A reload applies the new configuration while existing workers finish; do not repeatedly restart a service while debugging a configuration that has not passed its test.

4. Add HTTPS for the subdomain

Obtain a certificate covering second.example.com, or a suitable wildcard certificate if your operating model requires many subdomains. Add an HTTPS server block listening on 443 with the certificate and private-key directives, and keep the same document root, server_name, WordPress fallback and PHP-FPM handler. After confirming HTTPS works, redirect HTTP requests to the HTTPS hostname.

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

WordPress recommends SSL for every mapped domain. If another device terminates TLS before Nginx, make sure the proxy forwards the correct host and HTTPS indicators; otherwise WordPress can generate HTTP links or redirect in a loop.

5. Complete the WordPress installer

Open the final HTTPS subdomain in a browser. The normal installer should appear from the new document root. Enter the new database credentials, choose the site title and administrator account, and finish installation. In the WordPress Address and Site Address fields, use the final HTTPS URL, for example https://second.example.com, without accidentally entering the first site’s hostname.

If the browser shows the original site’s installer or content, stop and inspect Nginx selection before changing WordPress settings. The request may be landing in the first site’s server block.

Set up the subdomain in WordPress Multisite

1. Prepare the network before creating the site

Confirm DNS and the server mapping first. Back up the network’s database, files, wp-config.php and rewrite configuration. In the existing WordPress dashboard, enable the network feature using the documented Multisite preparation process, then open Network Admin and follow the network-creation screen.

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.
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.

WordPress displays directives that must be added to wp-config.php and rewrite rules that must be applied to the server configuration. Copy those generated values exactly for your installation; do not combine them with rules from an unrelated site.

2. Create the hostname-based site

In Network Admin, choose Sites, add a new site and enter the subdomain and site title. For a fixed hostname, an explicit DNS record is enough. If network administrators will create names on demand, the wildcard DNS record must already resolve those names to the same server.

The network’s shared Nginx block normally points to the single Multisite document root. Do not create a second independent document root unless you are intentionally running a separate installation. The hostname still has to be included in the relevant server_name handling, and the request must reach the network’s WordPress front controller.

3. Secure every mapped hostname

Issue a certificate that covers each mapped hostname or use a wildcard certificate appropriate to the network. Update the site’s URL in Network Admin if the initial value is wrong, then verify that both the network administration URL and the new site’s front end use HTTPS.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How Nginx decides which WordPress site to serve

When a browser connects, Nginx first matches the listen address and port, then evaluates server_name against the request’s Host header. If no name matches, Nginx uses the default server for that address and port. That is why a typo in the subdomain, an omitted name, or an unintended default-server declaration can show the first site’s content even though the second site’s files are present.

  • Use an exact server_name second.example.com; for a fixed site.
  • Do not point two independent installations at the same writable root.
  • Keep the root, index and PHP handler in the same server block that handles the hostname.
  • For Multisite, ensure the network’s host mapping and generated rewrite settings are applied to the block serving the shared root.

The try_files $uri $uri/ /index.php?$args; directive is essential for pages whose paths are not physical files. Without it, the home page may work while posts, pages and custom post-type URLs return 404.

Verify the complete request path

Test each layer in order so a later check does not hide an earlier failure.

  1. DNS: Query the hostname with your resolver tool and confirm it returns the server’s address. Test both the apex subdomain name and, where applicable, the wildcard-created name.
  2. Nginx syntax: Run the platform’s configuration test and read the reported file and line number. Reload only after it passes.
  3. HTTP host routing: Request the hostname explicitly and confirm the response is from the intended site, not the default virtual host.
  4. PHP execution: Load the WordPress front page and administrator login. A 502 usually means Nginx cannot reach the configured PHP-FPM socket or service.
  5. Pretty permalinks: Open a published post or page with its normal permalink. A 404 here usually indicates a missing or incorrect front-controller fallback or an incorrect root.
  6. Authentication: Sign in at /wp-admin/, navigate between the dashboard and front end, and confirm cookies remain on the same HTTPS hostname.
  7. Media: Upload an image and view it from the Media Library and from a post. This checks filesystem ownership, the uploads path and generated URLs.
  8. Logs: Review the Nginx error log and the PHP-FPM log while reproducing a failure. The exact log paths vary by distribution and hosting provider.

Troubleshoot the common failures

The hostname does not resolve

Fix the A, AAAA or CNAME record first. Check for an old record at another DNS provider, a typo in the hostname, or a wildcard that points somewhere else. Until DNS reaches this server, changing Nginx has no effect.

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

The first site’s content appears

Inspect the exact Host header, the spelling of server_name, the listen address and the default-server behavior. Confirm that the request reaches the configuration file you edited and that its root contains the second installation. A browser cache is less likely than a virtual-host mismatch, so verify with a fresh request and the Nginx access log.

Home page works but links return 404

Confirm that the location block contains try_files $uri $uri/ /index.php?$args;, that the root is the WordPress directory and that the request is handled by the intended block. In a Multisite network, recheck the rewrite directives generated during network creation.

Nginx returns 502 Bad Gateway

Check that PHP-FPM is running and that fastcgi_pass names its actual Unix socket or TCP endpoint. The socket often changes when the installed PHP version changes. Also check socket permissions and the PHP-FPM log for startup or pool errors.

Login loops or mixed-content warnings appear

Make the WordPress Address, Site Address, certificate names and public hostname agree on HTTPS. If a reverse proxy or TLS terminator sits in front of Nginx, configure the forwarded host and scheme headers so WordPress knows the original request was secure. Clear stale browser cookies only after the server-side hostname and scheme are correct.

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

The host is managed rather than self-administered

Ask the provider to create the DNS record, virtual host, PHP site and certificate. Managed hosts often use generated Nginx templates, nonstandard document roots and their own PHP-FPM pools; editing a system file directly can be overwritten or can take down other customers’ sites.

Operate both sites safely after launch

  • Keep separate-install databases, files and Nginx definitions clearly named so backups cannot be restored to the wrong site.
  • Document the PHP-FPM socket, document root, certificate locations and DNS records used by each hostname.
  • Apply WordPress core, plugin, theme and operating-system updates according to the architecture: independently for separate installs, with network-wide testing for Multisite.
  • Review file ownership after updates and verify that only required directories are writable by the web server.
  • Test certificate renewal before expiry and include every mapped hostname in the renewal process.
  • Retest the homepage, administrator login, a pretty permalink and a media upload after Nginx, PHP or DNS changes.

The WordPress Developer Resources handbook states that “WordPress supports Nginx.” The practical requirement is precise virtual-host routing: DNS must arrive at this server, Nginx must select the intended hostname and root, PHP-FPM must execute the correct installation, and WordPress must generate URLs for the same HTTPS subdomain.

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
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

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.