Question

Is there a way to setup a reverse proxy to an NGINX Wordpress site with Ghost droplet (NGINX > NGINX)

Hey guys, I’m tasked with getting an NGINX ran Wordpress site and a Ghost droplet (1click) working with a reverse proxy on the ghost droplet. Honestly I’m not sure how the heck to go about it because everything I’ve tried has stopped midway.

Here’s the setup: Site 1 - the wordpress site) www.site.com Site 2 - the ghost site) www.site.com/blog

Note: They’re both on NGINX (there’s not a lot of ngnix to nginx documenation out there which makes me wonder if this is where I’m messing up)

With ghost install giving me issues when doing a reverse proxy, I was planning on giving ghost a manual install after I got the reverse proxy setup.

Now I’ve followed the guide on How To Configure Nginx as a Web Server and Reverse Proxy for Apache on One Ubuntu 18.04 Server but I can never get the foobar.com and test.io up and running.

Has anyone done what I’m trying to do? Is there documentation out there on how to do it because I am legitimately stumped on why I can’t get this working.

I am quite new, and I hope this is enough information.

Thank you in advance for the help, and your patience with my lack of understanding


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hello,

You could indeed just use a reverse proxy to do that. It’s not a problem that both servers are Nginx.

So in your server block for your wordpress droplet you could add something like this:

location ~/blog(.*)$ {
    proxy_set_header X-Real-IP  $remote_addr;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header Host $host;
    proxy_pass http://your_ghost_droplet.com:80$1;
}

Hope that this helps! Bobby