Standalone discourse install issues and how to use a separate ip address?

I’ve been trying to figure out how to install discourse alongside my other Nginx sites, however, I continue get this message upon setup:

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

I made sure Cloudflare was NOT proxying the ip address. I am also using a secondary ip address that is attached to the server, there is already a Nginx website on the first one.

updated app.yml

templates:
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/web.template.yml"
  - "templates/web.ratelimited.template.yml"
  - "templates/web.socketed.template.yml"
## Uncomment these two lines if you wish to add Lets Encrypt (https)
#- "templates/web.ssl.template.yml"
#- "templates/web.letsencrypt.ssl.template.yml"

## which TCP/IP ports should this container expose?
## If you want Discourse to share a port with another webserver like Apache or nginx,
## see https://meta.discourse.org/t/17247 for details
#expose:
#- "25654:80" # http
#- "443:443" # https

updated nginx conf

server {
    listen <ip address>:80; listen [::]:80;
    server_name <domain>;  # <-- change this

    return 301 https://$host$request_uri;
}

server {
    listen <ip address>:443 ssl http2;  listen [::]:443 ssl http2;
    server_name <domain>;  # <-- change this

    ssl_certificate /data/web/discourse/shared/standalone/ssl/fullchain.pem;
    ssl_certificate_key /data/web/discourse/shared/standalone/ssl/privkey.pem;
    ssl_dhparam          /data/web/discourse/shared/standalone/ssl/dhparams.pem;
    ssl_session_tickets off;
    # removed from post: ssl_ciphers ...

    http2_idle_timeout 5m; # up from 3m default
    client_max_body_size 0;

    location / {
        proxy_pass http://unix:/data/web/discourse/shared/standalone/nginx.http.sock:;
        proxy_set_header Host $http_host;
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

What am I doing wrong?

Port 80/443 of your server are occupied by the other nginx server so discourse is unable to establish connections.

If you wish to run discourse along with other website on the same server, use this tutorial:

1 Like

Yeah I tried this as the first thing actually, but i’ll try again and report how it went!

Same thing sadly!

nginx conf

server {
    listen 80; listen [::]:80;
    server_name lush.gg;  # <-- change this

    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;  listen [::]:443 ssl http2;
    server_name lush.gg;  # <-- change this

    ssl_certificate /etc/letsencrypt/live/lush.gg/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/lush.gg/privkey.pem;
#    ssl_dhparam          /var/discourse/shared/standalone/ssl/dhparams.pem;
    ssl_session_tickets off;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA;

    http2_idle_timeout 5m; # up from 3m default
    client_max_body_size 0;

    location / {
        proxy_pass http://unix:/data/web/lush-discourse/shared/standalone/nginx.http.sock:;
        proxy_set_header Host $http_host;
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

app.yml

templates:
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/web.template.yml"
  - "templates/web.ratelimited.template.yml"
  - "templates/web.socketed.template.yml"
## Uncomment these two lines if you wish to add Lets Encrypt (https)
#- "templates/web.ssl.template.yml"
#- "templates/web.letsencrypt.ssl.template.yml"

## which TCP/IP ports should this container expose?
## If you want Discourse to share a port with another webserver like Apache or nginx,
## see https://meta.discourse.org/t/17247 for details
#expose:
#- "25654:80" # http
#- "443:443" # https

Got it! The trick was enabling DOCKER_USE_HOSTNAME: true

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