proxy_pass Not Working on Port 80

Reinis Rozitis r at roze.lv
Wed Sep 9 11:00:17 UTC 2020


> ----------------------------------
> #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;
>         }
> }


In this configuration nginx doesn't pass the Host header to backend.
In case there are multiple name based virtualhosts on the 192.168.3.5, you'll always get the default or first one (the order in the backend config).

Try to change to this and see if helps:

location / {
        proxy_pass http://192.168.3.5:80;
        proxy_set_header Host $host;
}

rr



More information about the nginx mailing list