Search code examples
apachesslproxyportforwardingcertbot

Apache Reverse Proxy behind port forwardind Timeout : 503 - Service Unavailable


Here is my situation, I have two reverse proxy servers, A and B.

Reverse proxy A directs the request to a hidden IP with a port number to the second server. Reverse proxy server B redirects the request to a local server.

Unfortunately, I have a problem with reverse proxy server B, it doesn't work, and I have a 503 - Service Unavailable code in the browser when I type the address of server A.

Here is a diagram:

[Internet] -> [Reverse Proxy A] -> {IP + Port} -> [Reverse Proxy B] -> [Local Server]

I tested the local IP address + the port, it works, the same for proxy A which of course redirects the expected request.

Here is the .conf file of proxy server B:

    <VirtualHost *:80>
        ServerName {hidden-ip}:3401
        ServerAlias {hidden-ip}:3401
        ProxyPreserveHost On
        ProxyPass / http://192.168.1.37:4401/
        ProxyPassReverse / http://192.168.1.37:4401/
    </VirtualHost>
    
<VirtualHost *:443>
    ServerName {hidden-ip}:3401
    ServerAlias {hidden-ip}:3401
    ProxyPreserveHost On
    <Proxy *>
    Order deny,allow
    Allow from all
    </Proxy>

    ProxyPass / http://192.168.1.37:4401/
    ProxyPassReverse / https://192.168.1.37:4410/
    
    <Location />
    Order allow,deny
    Allow from all
    </Location>
</VirtualHost>

What could be causing the malfunction?


Solution

  • In your configuration you have a typo error in

    1. scheme(http and https)below.
    2. Port number
    
    ProxyPass / http://192.168.1.37:4401/
     ProxyPassReverse / https://192.168.1.37:4410/
    

    change it as below

    ProxyPass / http://192.168.1.37:4401/
    ProxyPassReverse / http://192.168.1.37:4401/