Skip to content

Instantly share code, notes, and snippets.

@iandexter
Last active January 19, 2016 02:54
Show Gist options
  • Save iandexter/b59127082f617fb3a30f to your computer and use it in GitHub Desktop.
Save iandexter/b59127082f617fb3a30f to your computer and use it in GitHub Desktop.
Reverse proxy separate Wordpress instance
<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
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