WP Ghost works on Bitnami Nginx servers (AWS Lightsail, Google Cloud, Azure) with one manual step. Bitnami WordPress stacks running Nginx don’t use .htaccess files. After activating WP Ghost, you need to add an include line to the Bitnami Nginx server block config file so Nginx loads WP Ghost’s rewrite rules. This is a one-time edit. If your Bitnami stack uses Apache instead of Nginx, see the AWS Lightsail Apache Setup guide.

Why Bitnami Nginx Requires Extra Setup

Why Bitnami Nginx servers need a manual include for WP Ghost rewrite rules

Nginx doesn’t support .htaccess files. On standard Nginx servers, WP Ghost writes rewrite rules to a hidemywp.conf file and you include it in your Nginx config. Bitnami uses its own directory structure for Nginx config files, so you need to add the include line to the Bitnami-specific server block config. WP Ghost generates the hidemywp.conf file automatically in your WordPress root directory, and the include line tells Nginx where to find it.

Step 1: Activate WP Ghost

  1. Install and activate the WP Ghost plugin.
  2. Go to WP Ghost > Change Paths > Level of Security.
  3. Select Safe Mode or Ghost Mode.
  4. Click Save.
  5. WP Ghost displays a notification with the include line you need to add to the Nginx config.
WP Ghost notification showing the Nginx include line to add to the Bitnami server block config

Step 2: Add the Include to the Nginx Config

  1. SSH into your Bitnami instance.
  2. Open the Bitnami Nginx server block config file:
sudo nano /opt/bitnami/nginx/conf/server_blocks/myapp-server-block.conf
  1. Add the include line from the WP Ghost notification inside the server { } block:
server {
    listen 80 default_server;
    root /opt/bitnami/myapp;
    server_name _;
    include "/opt/bitnami/nginx/conf/bitnami/*.conf";

    # WP Ghost rewrite rules
    include /opt/bitnami/apps/wordpress/htdocs/hidemywp.conf;
}
  1. Save and exit: press Ctrl + X, then Y, then Enter.

Use the exact include line from WP Ghost’s notification. The file path depends on your WordPress installation location. The example above shows the default Bitnami path, but your path may differ. Always copy the include line directly from WP Ghost’s notification rather than typing it manually.

Newer Bitnami layout: If the config file path above doesn’t exist, your Bitnami instance may use a newer directory layout. Try /opt/bitnami/nginx/conf/server_blocks/wordpress-server-block.conf or run find /opt/bitnami/nginx -name "*server-block*" to locate the correct file.

Step 3: Restart Nginx and Test

  1. Test the Nginx config for syntax errors:
sudo nginx -t
  1. If the output shows syntax is ok and test is successful, restart Nginx:
sudo /opt/bitnami/ctlscript.sh restart nginx
  1. Go back to WP Ghost and run the Frontend Login Test.
  2. If everything loads correctly, click “Yes, it’s working”.
  3. If something is broken, click “No, abort” to roll back.
WP Ghost Frontend Login Test showing successful test with Yes it's working and No abort options

Troubleshooting

Nginx syntax error after adding the include

The hidemywp.conf file may not exist at the specified path, or the include line is placed outside the server { } block. Verify the file exists with ls -la /opt/bitnami/apps/wordpress/htdocs/hidemywp.conf. If it doesn’t exist, go back to WP Ghost and re-save your settings to regenerate it. Make sure the include line is inside the server { } block, not outside it.

Config file path doesn’t exist

Bitnami has changed its directory layout over time. Run find /opt/bitnami/nginx -name "*server-block*" to locate the correct server block config file. Newer Bitnami stacks may use /opt/bitnami/nginx/conf/server_blocks/wordpress-server-block.conf or similar paths.

Custom paths return 404

The include line may be placed after conflicting location blocks. Place the include line before any location / blocks in the server config so WP Ghost’s rewrite rules are processed first. Restart Nginx after adjusting placement.

Locked out after configuration

SSH into your instance and either fix the Nginx config or use the Safe URL parameter to bypass WP Ghost temporarily. If that doesn’t work, see the Emergency Disable guide.

Frequently Asked Questions

What if my Bitnami stack uses Apache instead of Nginx?

This guide is for Bitnami Nginx stacks. If your Bitnami WordPress installation uses Apache, follow the AWS Lightsail Apache Setup guide instead. You can check your web server with nginx -v (Nginx) or apachectl -v (Apache) via SSH.

Is the include a one-time setup?

Yes. The include line references the hidemywp.conf file, which WP Ghost updates automatically when you save settings. You only need to add the include line once. However, you do need to restart Nginx after changing WP Ghost path settings so Nginx reloads the updated config with sudo /opt/bitnami/ctlscript.sh restart nginx.

Does this work on all cloud providers?

Yes. This guide applies to Bitnami WordPress Nginx stacks on any cloud provider: AWS Lightsail, Google Cloud, Microsoft Azure, Oracle Cloud, or any host running Bitnami images. The directory structure and commands are the same regardless of cloud provider.

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.

Bitnami and server configuration: