Nginx Configuration for WordPress Multisite

Add and verify Nginx configuration for subdirectory or subdomain WordPress Multisite in WP Panel.

After manually converting an existing WordPress site to Multisite in WP Panel, you also need to ensure Nginx correctly handles subsite requests. This page explains how to add rules via „Custom Nginx Configuration“ in the site details.

Scope:You have completed the Multisite conversion in WordPress and the main site is accessible. WP Panel does not currently create or manage Multisite networks for you; some WordPress hosting updates, anomaly monitoring, and other single-site workflows do not support Multisite.

First confirm which Multisite mode is used

  • Subdirectory mode:Subsite URLs are likeexample.com/site-a/. Nginx rewrite rules need to be added.
  • Subdomain mode:Subsite URLs are likesite-a.example.com. Additional rewrites are usually not required, but each subsite domain requires correct DNS, site aliases, and SSL certificates.

Subdirectory mode: Add rewrite rules

Go toSite Management → Select Site → Site Details → SSL & Custom Nginx Configuration, expand „Nginx Custom Configuration“.

Paste the following content into„Location-level configuration (.conf)“:

if (!-e $request_filename) {
    rewrite /wp-admin$ $scheme://$host$uri/ permanent;
    rewrite ^(/[^/]+)?(/wp-.*) $2 last;
    rewrite ^(/[^/]+)?(/.*\.php) $2 last;
}

Click„Save and Apply“. The panel will validate the entire Nginx configuration and reload the service; if syntax validation or reload fails, it will report an error and attempt to restore the snippet from before saving.

Do not add additionallocation /。WP Panel already generates the defaultlocation /and PHP handling rules in the site configuration; duplicate definitions will cause Nginx configuration conflicts.

Subdomain mode: configure domain, DNS, and SSL

Subdomain mode typically does not require adding the rewrite above. Complete the following settings for each subsite in sequence:

  1. At your domain's DNS provider, point the A/AAAA records of the subsite domains to the WP Panel server.
  2. Go to the domain settings in the website details and add each subsite domain to „Aliases“, for examplesite-a.example.com、site-b.example.com。
  3. If HTTPS is enabled for the website, reissue the certificate to include these subsite domains.
  4. Confirm that the subsite addresses in the WordPress network administration exactly match the actual domains.

WP Panel currently does not accept*.example.comas a website alias, so you cannot build a wildcard Multisite with unlimited subdomains using only the panel's aliases and automatic SSL. You can add the actual subsite domains one by one.

How to verify after saving

  • Open the main site homepage, the subsite homepage, and the subsite admin panel separately.
  • Confirm/wp-admin/The address redirects and logs in normally.
  • Open a subsite post, media file, and permalink to confirm there are no 404s or redirect loops.
  • In subdomain mode, also check separately whether HTTP, HTTPS, and the certificate domain match.

FAQ

Which input field should the rules go in?

For subdirectory mode, place the rewrite in „Location-level configuration (.conf)“. Although the name contains „Location“, this content is actually inserted into the current site„sserverblock, before the default location.

Can I modify the Nginx site configuration file directly?

Not recommended. WP Panel manages and may regenerate the site configuration. Use the custom configuration entry in the site details to avoid losing manual changes when settings are later saved, repaired, or upgraded.

Once Nginx is working, can all WordPress features in the panel be used with Multisite?

No. Nginx rules only handle request routing. WP Panel can detect the Multisite status in its inventory, but it does not currently provide a complete Multisite hosting workflow; some core, plugin, and theme update and monitoring features will reject or not support Multisite.