I'm hoping someone here with experience with Apache can help me out. I have an internal server, that I'm fronting with Apache Reverse Proxy. i.e.
Apache Server: https://www.myexternalserver.com Internal Server: https://www.myinternalserver.com
Apache Settings
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
ProxyVia Off
ProxyRequests Off
ProxyPreserveHost On
SSLProxyEngine On
SSLProxyCheckPeerCN Off
SSLProxyCheckPeerExpire Off
SSLProxyCheckPeerName Off
SSLProxyVerify none
ProxyPass /internal https://www.myinternalserver.com
ProxyPassReverse /internal https://www.myinternalserver.com
<Location />
Allow from all
# Require all granted
</Location>
The problem I'm having is such:
- The internal application in code uses
getRequest().getContextPath()to get the url. If I turn offProxyPreserveHostand set it toOff, then the internal application ends up being the url that is returned. This is not what I want since this internal application url is not accessible to the public. - From what I've read,
ProxyPreserveHostneeds to beOnso that theApache Reverse Proxycan pass it's url to the underlying internal applications. When I do this however, I get a 404. I understand that what is probably happening is that the internal server is using the external domain to find its application and thus cannot find it. I'm not sure how to get around this. Btw, the internal application is hosted onPCF.
I would appreciate it if someone could help me out.
Thanks!
Aucun commentaire:
Enregistrer un commentaire