I have a scenario as below:
I have a URL with DNS Entry, say http://example.com
When the user enters http://example.com/portal
, (s)he lands on Apache (2.2) Web Server (say AWS 1). There I have a VirtualHost Entry which proxies the request to another Apache Web Server (say AWS 2) running on LAN, say IP 192.168.1.1
using reverse proxy.
The Apache Web Server on 192.168.1.1
then forwards the request to JBoss Application Server, using reverse proxy.
On doing so, the URL of the resultant page is changed to the LAN IP https:\\192.168.1.2\portal
.
I want the original URL to be intact, as the external users' system doesn't know what 192.168.1.2
is.
This is my first question. Please bear with me if it wasn't self-explanatory.
Below is the snippet of vhost file from AWS 1:
<VirtualHost 192.168.10.179:80>
ServerAdmin admin@example.com
DocumentRoot "D:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
ServerName example
ServerAlias example
ErrorLog "logs/example-error.log"
# use always https
Redirect pernament / https://example.com/
</VirtualHost>
Below is the snippet from ssl file of AWS 1 (its not the complete config):
<VirtualHost 192.168.10.179:443>
ServerAdmin admin@example.com
DocumentRoot "D:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
ServerName example
ServerAlias example
ErrorLog "logs/example-ssl-error.log"
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://192.168.1.1/
ProxyPassReverse / http://192.168.1.1/
</VirtualHost>
Below is the code snippet from vhost file of AWS 2:
<VirtualHost 192.168.1.1:80>
ServerAdmin admin@example.com
DocumentRoot "D:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
ServerName aws2
ServerAlias aws2
ErrorLog "logs/aws2.log"
# use always https
Redirect pernament / https://192.168.1.1/
</VirtualHost>
Below is the snippet from ssl file of AWS 2 (its not the complete config):
<VirtualHost 192.168.1.1:443>
ServerAdmin admin@example.com
DocumentRoot "D:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
ServerName aws2
ServerAlias aws2
ErrorLog "logs/aws2-ssl-error.log"
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://192.168.1.2/ #This is where JBoss is running
ProxyPassReverse / http://192.168.1.2/
</VirtualHost>