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 ( using the following vhost configuration:

<IfModule mod_proxy.c>
<VirtualHost *:443>
ServerName webapp.domain.com
ServerAlias www.webapp.domain.com
SSLProxyEngine On
SSLProxyCheckPeerExpire off
SSLProxyCheckPeerCN off
SSLProxyVerify none
ProxyPass /
ProxyPassReverse /
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
<IfModule mod_headers.c>
    Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains; preload"

<Proxy *>
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, connecting to 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?

1 Answer 1


I think the problem is here

ProxyPass /
ProxyPassReverse /

You are saying that every url using "/" needs to go to anotherIp/webapp/ .

Specifying webapp should solve the problem:

ProxyPass /webapp 
ProxyPassReverse /webapp
  • Thank you very much! Maybe I should use webapp.domain.com instead of /webapp? Since I expect users to connect to webapp.domain.com in order to access the webapp. Makes sense?
    – giovi321
    Commented Aug 29, 2017 at 15:48
  • You are already there, i mean webapp.domain.com is your localhost you don't need to specify that. Commented Aug 29, 2017 at 16:07
  • This does not solve the problem. webapp.domain.com should show what is at (regardless to whether it is webapp.domain.com or webapp.domain.com/webapp). The problem is that (that is the ip of the host machine) shows what is at
    – giovi321
    Commented Aug 29, 2017 at 16:33
  • try with this: ProxyPass / "" ProxyPassReverse / "" Commented Aug 29, 2017 at 18:26
  • Unfortunately this does not solve the issue
    – giovi321
    Commented Aug 30, 2017 at 7:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .