How to configure NGINX Proxy Manager to forward requests to Apache-hosted WordPress?

Hey everyone,

I’m stuck with a setup issue and could use some advice. I’ve got a WordPress site running on a TurnKey Linux appliance with Apache2. Now I need to set up NGINX Proxy Manager (NPM) to handle incoming requests and forward them to the WordPress server.

I’m pretty sure I need to tweak some advanced settings in NPM, but I can’t remember the exact configuration. I had this working on an old setup about a year ago, but now I’m drawing a blank.

Has anyone done this before? What settings should I look at in NPM to make this work? Any tips or step-by-step guidance would be super helpful!

Thanks in advance for any help you can offer!

I’ve dealt with a similar setup before. The key is to configure the proxy host correctly in NPM. First, add a new proxy host and set the domain name. For the scheme, choose http, and for the forward hostname/IP, use your WordPress server’s local IP.

In the advanced tab, you’ll want to add some custom locations. The crucial one is for PHP processing. Add a location block like this:

location ~ .php$ {
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
include fastcgi_params;
}

Adjust the PHP version as needed. Also, make sure you’ve enabled SSL if you want HTTPS.

Lastly, don’t forget to open the necessary ports on your firewall. Once you’ve done all this, NPM should successfully proxy requests to your Apache-hosted WordPress site.

hey, try settin up your npm proxy host: use your domain, http scheme, and point to your wp server ip. in the advanced settings, add a custom block for proxy passing. also enable ssl if needed. hope this helps!

I’ve gone through this exact process recently, so I can share what worked for me. The key is setting up the proxy host in NPM correctly.

In NPM, create a new proxy host. Use your domain name, set the scheme to http, and for the forward hostname/IP, use your WordPress server’s local IP address. Make sure the port is correct (usually 80 for http).

The tricky part is in the advanced settings. You need to add some custom nginx configurations. Here’s what I used:

location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_pass http://your_wp_server_ip;
}

This ensures proper header forwarding. Also, enable SSL if you want HTTPS.

After applying these settings, restart NPM and test. It should now properly forward requests to your Apache-hosted WordPress site.