Domeinnaam controleren mislukt achter NGINX proxy

AI-generated summary

felixoi is setting up a Discourse instance behind an NGINX proxy on a VM with an internal IP and encounters errors during domain validation via discourse-setup, specifically failing to reach ports 80 and 443. While manually editing containers/app.yml initially allowed access to the instance, obtaining an SSL certificate via Let’s Encrypt failed, suggesting misconfiguration. pfaffman advises that discourse-setup is unsuitable for non-standard setups like this and recommends manually editing app.yml, referencing a guide on Running other websites on the same machine as Discourse. The issue likely stems from the proxy not properly forwarding requests or the Discourse container not recognizing the external hostname during validation.

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

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