WP Ghost works on YunoHost self-hosted servers with Nginx configuration. YunoHost is a self-hosting platform that uses Nginx by default and stores per-domain Nginx configs in /etc/nginx/conf.d/. After activating WP Ghost, you add an include line to your domain’s Nginx config file via SSH or the YunoHost admin panel. This is a one-time setup.

Why YunoHost Needs WP Ghost Configuration

Why YunoHost Nginx servers need the hidemywp.conf include for WP Ghost path security

YunoHost uses Nginx, which doesn’t support .htaccess files. WP Ghost generates a hidemywp.conf file containing rewrite rules, and you need to add an include line to your domain’s Nginx configuration so Nginx loads these rules. YunoHost stores domain configs in /etc/nginx/conf.d/yourdomain.com.conf, which makes locating the right file straightforward.

Step 1: Activate WP Ghost

  1. Go to WP Ghost > Change Paths > Level of Security.
  2. Select Safe Mode or Ghost Mode and customize paths.
  3. Click Save.
  4. WP Ghost generates the hidemywp.conf file at /var/www/wordpress/hidemywp.conf (the default YunoHost WordPress path).

Step 2: Add the Include to the YunoHost Nginx Config

  1. SSH into your YunoHost server.
  2. Open your domain’s Nginx config file:
sudo nano /etc/nginx/conf.d/yourdomain.com.conf
  1. Add the include line before the existing YunoHost includes (the include /etc/nginx/conf.d/domain.com.d/*.conf; line):
include /var/www/wordpress/hidemywp.conf;
include /etc/nginx/conf.d/yourdomain.com.d/*.conf;
  1. Save and exit: press Ctrl + X, then Y, then Enter.

Use the exact path from WP Ghost’s notification. The default YunoHost WordPress path is /var/www/wordpress/, but yours may differ if you installed WordPress in a different location. Always verify the hidemywp.conf path from WP Ghost’s notification.

YunoHost may overwrite Nginx configs during updates. YunoHost manages Nginx configs for installed apps. If a YunoHost system update or WordPress app update regenerates the domain config, the include line may be removed. Check that it’s still present after YunoHost updates.

Step 3: Restart Nginx and Test

Restart Nginx to apply the changes. You can do this via SSH or the YunoHost admin panel.

Via SSH:

sudo nginx -t
sudo service nginx restart

Via YunoHost Admin Panel:

  1. Go to Tools > Services > NGINX.
  2. Click Restart.
  3. Verify the status shows Running and Configuration: valid.

After Nginx restarts, test in WP Ghost:

  1. Go to WP Ghost > Change Paths.
  2. Run the Frontend Test and the Login Test.
  3. If everything loads correctly, click “Yes, it’s working”.
  4. If something is broken, click “No, abort” to roll back.

After confirming everything works, you can turn off the Prevent Broken Layout option in WP Ghost for better performance. This option is a safety fallback during setup that you no longer need once the Nginx config is confirmed working.

Troubleshooting

Nginx won’t restart after adding the include

The hidemywp.conf file may not exist at /var/www/wordpress/. Verify with ls -la /var/www/wordpress/hidemywp.conf. If it doesn’t exist, go back to WP Ghost and re-save settings to regenerate it. Also check the include line is inside the server block, not outside it.

Include line disappears after YunoHost update

YunoHost may regenerate Nginx configs during system or app updates. Check /etc/nginx/conf.d/yourdomain.com.conf after updates and re-add the include line if it was removed. Restart Nginx after re-adding.

Custom paths return 404

The include may be placed after conflicting location blocks. Move it before the YunoHost app-specific includes. Restart Nginx after adjusting placement.

Locked out after configuration

SSH into your server and remove the include line from the Nginx config, then restart Nginx. Or use the Safe URL parameter to bypass WP Ghost temporarily. See the Emergency Disable guide for additional methods.

Frequently Asked Questions

Will YunoHost overwrite my Nginx changes?

Possibly. YunoHost manages Nginx configs for its installed apps. System updates or WordPress app updates may regenerate the domain config and remove custom includes. Check the config file after YunoHost updates and re-add the include line if needed.

Do I need to restart Nginx every time I save WP Ghost?

Yes, whenever you change path settings. WP Ghost updates hidemywp.conf automatically, but Nginx needs a restart to load the updated config. You can restart via SSH (sudo service nginx restart) or the YunoHost admin panel (Tools > Services > NGINX > Restart).

Where does YunoHost install WordPress?

The default YunoHost WordPress installation path is /var/www/wordpress/. WP Ghost generates hidemywp.conf in this directory. If your WordPress is installed at a different path, use the path from WP Ghost’s notification instead.

Does WP Ghost modify WordPress core files?

No. WP Ghost generates a separate hidemywp.conf file and uses WordPress hooks for application-level changes. No core files are modified. Deactivating WP Ghost restores all defaults instantly.

Nginx and self-hosted server configuration: