Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache Web Server : ProxyPass and ProxyPassReverse

I have scanned through internet and also stackoverflow and i'm still not sure the purpose of proxypass and proxypassreverse.

Why do we need proxypass (instead of using mod_jk) for apache server to connect to tomcat?

Anyone please?

like image 937
yapkm01 Avatar asked Jun 11 '12 17:06

yapkm01


1 Answers

The ProxyPassReverse is used to change the headers sent to Apache from a proxied app server, before Apache sends it to the browser.

For example, if the app sits on localhost:8080, it will respond with a redirect and location header of http://localhost:8080/new_path/, and Apache will take this and send it off to the browser. The browser will try to send a request to Page on localhost:8080 and receive an error.

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. The client makes ordinary requests for content in the namespace of the reverse proxy. The reverse proxy then decides where to send those requests and returns the content as if it were itself the origin.

https://www.quora.com/Whats-the-difference-between-proxypassreverse-and-proxypass

https://httpd.apache.org/docs/2.4/mod/mod_proxy.html

like image 164
Yan Khonski Avatar answered Sep 19 '22 13:09

Yan Khonski