proxy_pass Not Working on Port 80

figshta nginx-forum at forum.nginx.org
Wed Sep 9 05:58:42 UTC 2020


I have two servers behind on IP address. Server1 is hosting several websites
all using TLS exclusively.
 Recently I set up Server2 and setup one website using reverse proxy from
Server1 and finally successfully deployed TLS on it as well. 
During that setup I had to use port 80 to use Certbot with Let's Encrypt. 
Now I'm trying to do it again the same way with another domain. 
The proxy_pass directive works on port 8080, but when I switch it to port 80
I get a 404 error.

Here is setup in question: (again, Port 8080 works, but port 80 does not)

----------------------------------
#Proxy server (Server1)

# threedaystubble.com server
server {
        listen 80;
        server_name www.threedaystubble.com threedaystubble.com;
        location / {
                proxy_pass http://192.168.3.5:80;
        }
}


#Proxied Server (Server2)

server {
        listen 80;

        server_name threedaystubble.com www.threedaystubble.com;

        root /var/www/threedaystubble.com;

        location / {
        }

}

--------------------------------------

Also, I checked if anything was happening on port 80 on both machines with
net stat -plant:

Server1 
Proto Recv-Q Send-Q Local Address           Foreign Address         State   
   PID/Program name
tcp               0            0  0.0.0.0:80                 0.0.0.0:*      
              LISTEN      -

Server2
Proto Recv-Q Send-Q Local Address           Foreign Address         State   
   PID/Program name
tcp               0           0  0.0.0.0:8080             0.0.0.0:*         
            LISTEN      -                   
tcp               0           0  0.0.0.0:80                 0.0.0.0:*       
              LISTEN      -

Any help would be greatly appreciated.

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,289348,289348#msg-289348



More information about the nginx mailing list