Richard Zheng
Richard Zheng

Reputation: 179

How to configure WPEngine to work with DigitalOcean and Nginx

I have a WPEngine server running on all of the Wordpress made .com urls, and I also have a webapp running on a DigitalOcean droplet managed by Docker and using Nginx as a reverse proxy for that application. How can I map a wildcard domain (e.g. test.company.com) to the DigitalOcean droplet and have it serve up the web app from that url and add SSL to it?

Upvotes: 1

Views: 769

Answers (1)

lukewarm
lukewarm

Reputation: 857

You should be able to configure the Nginx instance as a reverse proxy to forward requests on to the WPEngine instance and then return responses to the requester.

A very simple configuration you could start with would be something like this:

server{
    listen    80;
    server_name    test.company.com;

    location  / {
        proxy_pass          https://exampleblog.wpengine.com:443/;
        proxy_set_header    Host                 exampleblog.wpengine.com;
    }

}

For a more complete example that discusses caching and remapping of the WPEngine content to a /blog/ subdirectory you can read this blog article.

Good luck!

Upvotes: 2

Related Questions