How do these two code blocks differ?
ProxyPass /app http://10.0.0.10/blah
ProxyPassReverse /app http://10.0.0.10/blah
versus
<Location /app>
ProxyPass http://10.0.0.10/blah
ProxyPassReverse http://10.0.0.10/blah
</Location>
Thanks!
ProxyPassReverse will intercept those headers, and rewrite them to match the Apache proxy server. ProxyPass will create a reverse proxy. A reverse proxy (or gateway), appears to the client just like an ordinary web server.
Apache ProxyPassReverse exampleThe Apache reverse proxy handles the incoming request, recognizes that an Apache ProxyPassReverse setting exists, and then forwards the request to Tomcat. Then Tomcat handles the request, returns a response to the Apache reverse proxy, and Apache returns the response to the client.
ProxyPass is the main proxy configuration directive. In this case, it specifies that everything under the root URL ( / ) should be mapped to the backend server at the given address.
Using the Location
Directive is the preferred method to use. The alternative syntax of Proxypass
like this ProxyPass /app http://10.0.0.10/blah
can have performance impact when there are many. However depending on your need the alternative syntax might be better.
From the documentation:
The following alternative syntax is possible, however it can carry a performance penalty when present in very large numbers. The advantage of the below syntax is that it allows for dynamic control via the Balancer Manager interface:
ProxyPass "/mirror/foo/" "http://backend.example.com/"
Please have a look at the documentation for more info.
http://httpd.apache.org/docs/current/mod/mod_proxy.html#proxypass
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With