How to configure reverse proxy using mod_proxy without redirection?

How to configure reverse proxy using mod_proxy without redirecting to another server or IP? This will be a virtual host environment. The reason I want to do this is because mod_proxy handles communication with the client browser, thereby freeing the web server processes to serve the next request, and not to load the client browser. This is especially important when using language modules such as mod_php with MPM Prefork. The flow I am trying to achieve is: 1. Traffic is allowed on www.mydomain.com on port 80. 2. The proxy sends a request to the web server. 3. The web server sends the response back to the proxy server and disconnects from the proxy server. 4. The proxy server transmits the client’s browser.

As soon as this works, I want to add nginx to the same IP address, but for requests to port 81 and the proxy image for nginx on the same server. I do not want nginx to handle the proxy server, and I do not want to use anything FCGI. I want my standard Apache mod_rewrite and .htaccess to work.

Thanks Tons!

+3
source share
2 answers

Just redirect to localhost to another port? Send your application to port 8080 and use mod_proxyto forward requests:

ProxyPass /foo http://localhost:8080/foo
ProxyPassReverse /foo http://localhost:8080/foo

, , , , . .

, , mod_php. - .

+3

, 2

LoadModule proxy_module bin/mod_proxy.so 
LoadModule proxy_http_module bin/mod_proxy_http.so

ProxyPass /TeamCity http://localhost/TeamCity
ProxyPassReverse /TeamCity http://localhost/TeamCity
0

Source: https://habr.com/ru/post/1709249/


All Articles