Discussion:
Apache2 proxypass to apache2: double subpath
(too old to reply)
g***@gmail.com
2018-10-10 14:43:36 UTC
Permalink
I premise I'm not an apache2 wizard or expert so you can freely call me noob. I have this problem: two servers with two distinct apache2, the first accepting requests from internet and forwarding them to the second, the second managing requests and retrieving files from the filesystem.

I set the virtual host of the first in this way:
<VirtualHost *:443>

ServerName www.asd.mysite.it
ServerAlias asd.mysite.it

SSLProxyEngine On
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off
SSLCertificateFile certificate.crt
SSLCertificateKeyFile private.key
SSLCertificateChainFile ca_bundle.crt

ErrorLog /var/log/apache2/error_log_bugs
CustomLog /var/log/apache2/access_log_bugs combined

ProxyRequests Off
ProxyPreserveHost On
RewriteEngine on

ProxyPass / http://192.168.0.53/mantisbt/
ProxyPassReverse / http://192.168.0.53/mantisbt/

</VirtualHost>

I set the virtual host of the second in this way:
<VirtualHost *:80>

ServerAdmin ***@localhost
DocumentRoot /var/www/html

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

<Directory "/mantisbt">
AllowOverride All
</Directory>

</VirtualHost>

Under /var/www/html/mantisbt/ there is the MantisBT site (php, subfolders and so on).

If in my browser I insert http://192.168.0.53/mantisbt/ I see the right page, if I insert asd.mysite.it my url is translated in https://asd.mysite.it/mantisbt/login_page.php and I have the error:

The requested URL /mantisbt/mantisbt/login_page.php was not found on this server.

I can't understand why the mantisbt folder is repeated twice. Where am I wrong?

Thanks
Eli the Bearded
2018-10-10 19:37:06 UTC
Permalink
Post by g***@gmail.com
ProxyPass / http://192.168.0.53/mantisbt/
ProxyPassReverse / http://192.168.0.53/mantisbt/
...
Post by g***@gmail.com
If in my browser I insert http://192.168.0.53/mantisbt/ I see the
right page, if I insert asd.mysite.it my url is translated in
The requested URL /mantisbt/mantisbt/login_page.php was not found on this server.
I can't understand why the mantisbt folder is repeated twice. Where am I wrong?
I think you either want to put https://asd.mysite.it/login_page.php into
your browser, or change the proxy config:

ProxyPass /mantisbt/ http://192.168.0.53/mantisbt/
ProxyPassReverse /mantisbt/ http://192.168.0.53/mantisbt/

But this comes from not being overly familiar with Apache as a reverse
proxy, so I'm not certain.

Elijah
------
has used nginx for reverse proxying
g***@gmail.com
2018-10-11 06:59:18 UTC
Permalink
Post by Eli the Bearded
Post by g***@gmail.com
ProxyPass / http://192.168.0.53/mantisbt/
ProxyPassReverse / http://192.168.0.53/mantisbt/
...
Post by g***@gmail.com
If in my browser I insert http://192.168.0.53/mantisbt/ I see the
right page, if I insert asd.mysite.it my url is translated in
The requested URL /mantisbt/mantisbt/login_page.php was not found on this server.
I can't understand why the mantisbt folder is repeated twice. Where am I wrong?
I think you either want to put https://asd.mysite.it/login_page.php into
ProxyPass /mantisbt/ http://192.168.0.53/mantisbt/
ProxyPassReverse /mantisbt/ http://192.168.0.53/mantisbt/
But this comes from not being overly familiar with Apache as a reverse
proxy, so I'm not certain.
Elijah
------
has used nginx for reverse proxying
Hi

Yes, also https://asd.mysite.it/login_page.php or another page can be accepted by the browser, but I don’t know how to change my apache conf :(

Thanks

Loading...