Apache reverse proxy redirects every address to the same vhost
0
votes
1
answer
952
views
I have installed a webapp in a virtual machine on my server (both running Debian 8 and Apache2). I used a reverse proxy on the host machine to redirect all the connections made to https://webapp.domain.com to the internal address of the webapp on the virtual machine (http://192.168.100.101/webapp) using the following vhost configuration:
ServerName webapp.domain.com
ServerAlias www.webapp.domain.com
SSLProxyEngine On
SSLProxyCheckPeerExpire off
SSLProxyCheckPeerCN off
SSLProxyVerify none
ProxyPass / http://192.168.100.101/webapp/
ProxyPassReverse / http://192.168.100.101/webapp/
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/webapp.domain.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/webapp.domain.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/webapp.domain.com/fullchain.pem
ServerAdmin unavailable
CustomLog ${APACHE_LOG_DIR}/vhosts/webapp_access.log combined
ErrorLog ${APACHE_LOG_DIR}/vhosts/webapp_error.log
Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"
Order Allow,Deny
Allow from all
However if I try to connect to any address on the ip of the host machine, I end up seeing the webapp on the virtual machine (i.e., let's assume that the public IP of the host machine is 10.10.10.10, connecting to https://10.10.10.10/anything shows me the webapp on the virtual machine).
How can I prevent this from happening? Could it be the guest machine configuration the cause of this?
Asked by giovi321
(919 rep)
Aug 29, 2017, 03:34 PM
Last activity: Aug 29, 2017, 03:47 PM
Last activity: Aug 29, 2017, 03:47 PM