I'm setting up a proxy to let a totally isolated vlan (called VLAN1) to access to another vlan (VLAN2) via proxy.
One server has two NICs : on for VLAN1 (10.1.1.50) and one for VLAN2 (10.1.2.254).
On my VLAN1, I've several server running the SAME web application (for different users) :
- https: //10.1.1.101/myapp
- https: //10.1.1.102/myapp
- https: //10.1.1.103/myapp
- ...
On my proxy server (10.1.2.254 or 10.1.1.50), on the file /etc/httpd/conf.d/myapp.conf :
ServerName Proxy-IsolatedNetwork
#
# SSL
#
SSLProxyCheckPeerCN Off
SSLProxyCheckPeerExpire Off
SSLProxyCheckPeerName Off
SSLProxyEngine On
SSLProxyProtocol All
SSLProxyVerify optional_no_ca
SSLProxyVerifyDepth 0
#
# Proxy
#
ProxyPreserveHost On
CASE 1
If I write this, it works :
ProxyPass /101 https://10.1.1.101/myapp
ProxyPassReverse /101 https://10.1.1.101/myapp
ProxyPass /myapp https://10.1.1.101/myapp
ProxyPassReverse /myapp https://10.1.1.101/myapp
If we go to https: //10.1.2.254/101, it works, I've access to myapp hosted on https: //10.1.1.101/myapp
BUT
CASE 2
What I would like is :
- https: //10.1.2.254/101 => https: //10.1.1.101/myapp
- https: //10.1.2.254/102 => https: //10.1.1.102/myapp
- https: //10.1.2.254/103 => https: //10.1.1.103/myapp
How to have multiple ProxyPass/ProxyPassReverse working ?
ProxyPass /101 https://10.1.1.101/myapp
ProxyPassReverse /101 https://10.1.1.101/myapp
ProxyPass /myapp https://10.1.1.101/myapp
ProxyPassReverse /myapp https://10.1.1.101/myapp
ProxyPass /102 https://10.1.1.102/myapp
ProxyPassReverse /102 https://10.1.1.102/myapp
ProxyPass /myapp https://10.1.1.102/myapp
ProxyPassReverse /myapp https://10.1.1.102/myapp
ProxyPass /103 https://10.1.1.103/myapp
ProxyPassReverse /103 https://10.1.1.103/myapp
ProxyPass /myapp https://10.1.1.103/myapp
ProxyPassReverse /myapp https://10.1.1.103/myapp
the answer is to turn off the ProxyPreserveHost then I can delete all line ProxyPass /myapp & ProxyPassReverse /myapp