0

I have a reverse proxy set up on nginx, which is working fine to redirect traffic to one html website internally.

I decided to look into hosting my own Wordpress server for my blog. I have a VM server up and running with Wordpress installed and serving my content, but can't seem to find the required configuration for my nginx reverse proxy to redirect this traffic

I've got this so far...

server {
    listen 80;
    server_name blog.example.com;

    location / {
        proxy_pass http://192.168.1.192; # Wordpress server IP address
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

I've got this to work initially using the following edits to the Wordpress config:

define('WP_HOME','http://blog.mysite.com');
define('WP_SITEURL','http://blog.mysite.com');

...however is there a way to do this on the nginx reverse proxy instead?

migrated from superuser.com Feb 13 at 17:19

This question came from our site for computer enthusiasts and power users.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.