0

I am trying to use apache reverse proxy in order to expose a webapp running on a vm in the vpn network to which the host machine is connected.

Basically, it should look like this:

VM(192.168.56.107) --> host(192.168.56.100,10.10.10.10) --> reverse proxy --> vpn --> client

I have tried the following configuration on apache2 on the host

    <IfModule mod_proxy.c>
    <VirtualHost 10.10.10.10:80>
    ServerName 10.10.10.10
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
    </VirtualHost>

    <VirtualHost 10.10.10.10:443>
    ServerName 10.10.10.10
    SSLProxyEngine On
    SSLProxyCheckPeerExpire off
    SSLProxyCheckPeerCN off
    SSLProxyVerify none
    ProxyPass /webapp/ http://192.168.56.107:8384/
    ProxyPassReverse /webapp/ http://192.168.56.107:8384/
    SSLEngine on
    SSLCertificateFile    /etc/apache2/ssl/server.crt
    SSLCertificateKeyFile /etc/apache2/ssl/server.key
    CustomLog ${APACHE_LOG_DIR}/vhosts/webapp_access.log combined
    ErrorLog ${APACHE_LOG_DIR}/vhosts/webapp_error.log
    <Proxy *>
    Order Allow,Deny
    Allow from all
    </Proxy>
    </VirtualHost>
    </IfModule>

However, with my current configuration I cannot connect to the webapp as when I enter the correct IP in the browser (https://10.10.10.10/webapp/) I get redirected to the vm internal IP (192.168.56.107).

user3161330
  • 101
  • 2
  • 1
    Are you redirected to 192.168.56.107:443 or 192.168.56.107:8384? If the former, seems like the `ProxyPassReverse` part is not working as it should. I personally prefer using `haproxy` for applications like this. – wurtel May 01 '19 at 11:41
  • It redirects to 192.168.56.107:8384 – user3161330 May 05 '19 at 08:46

0 Answers0