Revision as of 18:33, 1 December 2011 by Blargman
Nginx solution for Apache ProxyPassReverse
Let's say we want to establish simple proxy between myhost:80 and myapp:8080. The Apache rule is simple:
<VirtualHost myhost:80> ServerName myhost DocumentRoot /path/to/myapp/public ProxyPass / http://myapp:8080/ ProxyPassReverse / http://myapp:8080/ </VirtualHost>
But Nginx does not have ProxyPassReverse...The solution is adding few missing HTTP headers.
- Please also see http://wiki.nginx.org/HttpProxyModule#proxy_redirect , This wiki is partly incorrect. If you need to do location header rewriting. You will need to use proxy_redirect as well.