Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache ProxyPass: standalone vs location tag?

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!

like image 555
Joe Fruchey Avatar asked May 13 '15 13:05

Joe Fruchey


People also ask

What is the difference between ProxyPass and ProxyPassReverse?

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.

How does Apache ProxyPass work?

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.

What is the use of ProxyPass?

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.


1 Answers

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

like image 100
Panama Jack Avatar answered Sep 27 '22 23:09

Panama Jack