Welcome! Log In Create A New Profile

Advanced

Re: RE: proxy_pass Not Working on Port 80

September 09, 2020 10:40AM
Thank you Francis and Rennis.
I really appreciate your help, unfortunately it isn't working yet...

Are there any another ways to trouble shoot this port problem?

Rennis:
Your suggestion looked so promising.

> 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).

It really makes sense because I do have another configuration pointing to this backend server; it is, however, on port 443.

Here is the complete proxy configuration for both sites on Server1: (I added the proxy_set_header directive as suggestedl)

#Proxy server (Pi3) (Server1)
# houseofavi.com server
server {
listen 443;
server_name houseofavi.com;
location / {
proxy_pass https://192.168.3.5:443;
proxy_set_header Host $host;
}

ssl_certificate /etc/letsencrypt/live/houseofavi.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/houseofavi.com/privkey.pem; # managed by Certbot
}

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

Are there another ideas to allow port 80?

Francis:

I don't want to use port 8080 or 8081 because Certbot requires port 80 and it should work.
I plan to have everything on port 443 once it's all set up.
I am however, now concerned about running into trouble with multiple sites using 443.
It it difficult?
I hope I can pass various requests to different "virtual" server blocks on the same port.

Here both server configurations on Server2 in case it helps.

#Proxied Server (Server2)
#houseofavi.com
server {
if ($host = houseofavi.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name houseofavi.com;
return 404; # managed by Certbot
root /var/www/houseofavi.com;
}

server {
listen 443 ssl; # managed by Certbot
root /var/www/houseofavi.com;
location / {
}
ssl_certificate /etc/letsencrypt/live/houseofavi.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/houseofavi.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}

#Proxied Server (Server2)
#threedaystubble.com
server {
listen 80;
server_name threedaystubble.com www.threedaystubble.com;
root /var/www/threedaystubble.com;
location / {
}
}
Subject Author Posted

proxy_pass Not Working on Port 80

figshta September 09, 2020 01:58AM

Re: proxy_pass Not Working on Port 80

Francis Daly September 09, 2020 04:58AM

RE: proxy_pass Not Working on Port 80

Reinis Rozitis September 09, 2020 07:02AM

Re: RE: proxy_pass Not Working on Port 80

figshta September 09, 2020 10:40AM

Re: RE: proxy_pass Not Working on Port 80

Francis Daly September 09, 2020 04:48PM

Re: RE: proxy_pass Not Working on Port 80

figshta September 10, 2020 01:31AM

Re: RE: proxy_pass Not Working on Port 80

Francis Daly September 10, 2020 04:18AM

Re: RE: proxy_pass Not Working on Port 80

figshta September 10, 2020 11:11AM

Re: RE: proxy_pass Not Working on Port 80

Francis Daly September 11, 2020 04:24AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 225
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready