Score:0

nginx reverse proxy gateway not behaving with ssl

br flag

port 80 on the web server destination serer 192.168.0.43 works in every way: gateway and inside the lan. Perfect.

I have the certbot certs on the gateway 192.168.0.60 generating perfectly

the domain points to the gateway outward facing ip i.e. 192.168.0.60 has an outward facing IP and listens on port 80 and port 443 for the domain madeupexample.com

this is the gateway nginx conf on 192.168.0.60

server{
# SSL configuration
#
        listen 443 ssl default_server;
        listen [::]:443 ssl default_server;

        server_name madeupexample.com www.madeupexample.com;

        ssl_certificate /etc/letsencrypt/live/www.madeupexample.com/fullchain.pem; # managed by Certbot
        ssl_certificate_key /etc/letsencrypt/live/www.madeupexample.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

        ssl_session_cache shared:SSL:1m;

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


        error_page 404 /404.html;
                location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
                location = /50x.html {
        }
}

server {
   listen 80;

   server_name madeupexample.com www.madeupexample.com;

    if ($host = madeupexample.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    if ($host = www.madeupexample.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

   return 404; # managed by Certbot
}

this used to work fine

server {
    listen 80;
    server_name madeupexample.com www.madeupexample.com;

    location / {
         proxy_pass http://192.168.0.43;
    }
}

what am I doing wrong? the domain just spins

in flag
`the domain just spins`? Please provide actual error messages you encounter.
Mr Heelis avatar
br flag
the domain `https://www.madeupexample.com` and the 80 version `http://www.madeupexample.com` spin in the browser until the browser says `Connection has timed out`. If I change the nginx conf back to the port 80 only version it works immediately for `http://www.madeupexample.com` only however.
in flag
A timeout usually points toward a firewall issue.
Mr Heelis avatar
br flag
you're right I didn;t know `ufw http` didn't also add `ufw https` thank you it's fixed
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.