SOLVED: disabling server nginx, running discourse-setup, enabling server nginx and rebuilding the app.
Hi there. I trying to install Discourse following this guide.
This is my edited app.yml (copied from discourse folders and edited following the guides):
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: # - "80:80" # http # - "2222:22" # - "443:443" # https
That’s my discourse.conf nginx block:
server {
server_name forum.myhost; # listen [::]:443 ssl http2 ipv6only=on; # managed by Certbot listen 443 ssl http2; # managed by Certbot ssl_certificate /etc/letsencrypt/live/forum.myhost/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/forum.myhost/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 on; http2_idle_timeout 5m; # up from 3m default; location / { proxy_pass http://unix:/var/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; } } server { if ($host = forum.myhost) { return 301 https://$host$request_uri; } # managed by Certbot server_name www.forum.myhost; return 301 $scheme://forum.myhost$request_uri; listen 80; listen [::]:80; server_name forum.myhost; return 404; # managed by Certbot }
The server is working with SSL (Certbot installed) and redirects http to https in primary domain but forum domain shows 502 Gateway error. I’m using Cloudflare (without performance or security options enabled).
Any kind of help will be very appreciated. I can’t execute discourse-setup because it shows “Google: “open ports YOUR CLOUD SERVICE” for information for resolving this problem.”
Checked firewall too.
EDIT: Maybe a problem with this line? (I don’t see this file in folder)
proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock;