Checking domain name fails behind NGINX proxy

Hey there.

I’m trying to spin up a discourse instance on a vm which only has an internal ip address and can only be reached over a nginx proxy on another vm. Therefor the proxy contains the following config:

upstream forums {
    server 10.240.10.19:443;
    server 10.240.10.19:80;
}

server {
    listen 443 ssl;
    server_name SECRET;

    access_log /var/log/nginx/SECRET_access.log;
    error_log /var/log/nginx/SECRET_error.log;

    location / {
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        add_header X-Host $host;
        expires 0m;
        proxy_pass http://forums;
    }

    ssl_certificate /etc/letsencrypt/live/SECRET/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/SECRET/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}

Trying to use discourse-setup i get the error:

WARNING: Port 443 of computer does not appear to be accessible using hostname:  SECRET
WARNING: Connection to http://SECRET (port 80) also fails.

Just editing the stuff in containers/app.yml worked fine at first and the instance was reachable. Trying to obtain a ssl cert using the inbuild letsencrypt stuff also failed tho. So I guess something is wrong here and I hope someone of you knows what it is.

Thanks,
felixoi

1 Like

You’ll need to edit your app.yml by hand. Discourse-setup is a tool only for standard configurations. See Running other websites on the same machine as Discourse

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.