Content
Apache double reverse proxy
Added by Sridhar Malkaram over 3 years ago
I want to configure open project with two apache proxy servers. The first proxy server is internet facing. The second proxy server is behind NAT router. The port 8443 from first proxy is forwarded to port 443 on second proxy server.
The first proxy server has the following directives
##PROXY1 on HOST1
<VirtualHost *:443>
ServerName openproject.myexample.com
ServerAlias www.myexample.com
ProxyPass / https://127.0.0.1:8443/ retry=0
ProxyPassReverse / https://127.0.0.1:8443/
ProxyPreserveHost On
ProxyRequests Off
ProxyVia On
</VirtualHost>
The second proxy has the following
##PROXY2 on HOST2
<VirtualHost *:443>
ServerName openproject.myexample.com
ProxyPass / http://127.0.0.1:6000/ retry=0
ProxyPassReverse / http://127.0.0.1:6000/
ProxyPreserveHost Off
ProxyRequests Off
ProxyVia Off
</VirtualHost>
However this configuration is not working when I browse https://openproject.myexample.com from HOST1. I just see a blank page.
However, when I browse at https://openproject.myexample.com from HOST2 it works fine.
I can also see other website pages on HOST2 from HOST1. For example https://www.myexample.com, which is pointing to "/var/ww/html/index.html".
Could you please let me know what I am doing wrong?
Replies (2)
You're trying to configure a setup with two Apache proxy servers. For the first server, ensure proper proxy settings like ProxyPass and ProxyPassReverse to forward traffic to the second server. You should also ensure SSL is correctly configured on both proxies, especially since you're forwarding to port 443 on the second server.
btw, if you're setting up an Apache double reverse proxy, it can be tricky but doable. The basic idea is to have Apache as a middleman between your clients and the backend servers. You would configure Apache to forward requests to another Apache server or another web server entirely.