• Apache2 proxypass to apache2: double subpath

    From gianmarco.gallo@gmail.com@21:1/5 to All on Wed Oct 10 07:43:36 2018
    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 webmaster@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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eli the Bearded@21:1/5 to gianmarco.gallo@gmail.com on Wed Oct 10 19:37:06 2018
    In comp.infosystems.www.servers.unix, <gianmarco.gallo@gmail.com> wrote:
    ProxyPass / http://192.168.0.53/mantisbt/
    ProxyPassReverse / http://192.168.0.53/mantisbt/
    ...
    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?

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From gianmarco.gallo@gmail.com@21:1/5 to All on Wed Oct 10 23:59:18 2018
    Il giorno mercoledì 10 ottobre 2018 21:37:07 UTC+2, Eli the Bearded ha scritto:
    In comp.infosystems.www.servers.unix, <gianmarco.gallo@gmail.com> wrote:
    ProxyPass / http://192.168.0.53/mantisbt/
    ProxyPassReverse / http://192.168.0.53/mantisbt/
    ...
    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?

    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

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)