Last active
January 19, 2016 02:54
-
-
Save iandexter/b59127082f617fb3a30f to your computer and use it in GitHub Desktop.
Reverse proxy separate Wordpress instance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost> | |
... | |
### START - Blog redirection | |
RewriteRule ^/blog$ /blog/ [R=301] | |
<Proxy *> | |
Order deny,allow | |
Allow from all | |
</Proxy> | |
ProxyRequests off | |
ProxyPass /blog/ http://url.of.separate.blog/ | |
ProxyPassReverse /blog/ http://url.of.separate.blog/ | |
### END - Blog redirection | |
... | |
</VirtualHost |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
... | |
location ^~ /blog { | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $remote_addr; | |
proxy_set_header Host url.of.separate.blog; | |
client_max_body_size 10m; | |
client_body_buffer_size 128k; | |
proxy_max_temp_file_size 0; | |
proxy_connect_timeout 90; | |
proxy_send_timeout 90; | |
proxy_read_timeout 90; | |
proxy_buffers 32 4k; | |
proxy_redirect http://url.of.main.site/ /; | |
proxy_redirect http://$host/ /; | |
proxy_pass http://url.of.separate.blog; | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment