Issue
Given I have two separate EC2 instances:
35.0.0.1 - this one runs a web application for the main site
35.0.0.2 - this one runs the wordpress blog
How do I set up DNS and/or reverse proxies so that:
example.com - will load the web app from the first server
example.com/blog(*?) - will render pages from the WP instance on the second server
If it matters, server 1 uses nginx and server 2 uses Apache.
Solution
You could do this using reverse proxy. Since you have nginx installed at server 1
You can configure the server 2 as backend for the reverse proxy on server 1 for /blog
uri.
And let your DNS point to server 1 for your domain example.com.
Config for backend and proxy setup for /blog in nginx-
upstream blog{
server 35.0.0.2 weight=1 max_fails=2 fail_timeout=15s;
}
location /blog/ {
proxy_pass http://blog;
}
Answered By - mdeora Answer Checked By - Timothy Miller (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.