Installing discourse with http only (no https)

AI-generated summary

A user is trying to install Discourse with an existing nginx server handling SSL and HTTPS redirection. They want to run plain HTTP between the nginx server and the Discourse installation, but are encountering issues.

The user has commented out SSL-related lines in app.yml and rebuilt the app, but the HTTP server won’t start. Benjamin_D suggests using the web.socketed template to solve the issue, and points to a relevant Meta Discourse topic about running multiple websites on the same machine as Discourse.

I am trying to install discourse on my system but am not having any success.
I have a nginx server running on a host machine and discourse is running in a dedicated VM on that host. The nginx server takes acre of all ssl and all http to https redirection. I would like to run plain http between the nginx and the discourse installation. But I do not know how to disable discourse from using ssl.

With ssl configured, discourse sends and endless redirect sequence from my http source to https.

Here is my nginx config snippet

server {
  listen 443 ssl;
  listen [::]:443 ssl;

  server_name forum.example.com;

  # SSL config ...
        ssl_certificate         /etc/nginx/certificates/cloudflare-example.com.pem;
        ssl_certificate_key     /etc/nginx/certificates/cloudflare-example.com.key;

  # Reverse proxy to Discourse:
  location / {
    proxy_pass http://192.168.1.123:80/;
    proxy_http_version 1.1;
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_read_timeout 120;
  }
}

I have tried to comment out the lines:

- “templates/web.ssl.template.yml”

- “templates/web.letsencrypt.ssl.template.yml”

from app.yml, and then rebuilding using
./launcher rebuild app
but the http server doesn’t start up

Are there any instructions for such a setup somewhere? Or do I have to confgure ssl between my nginx and discourse?

I assume that’s because your nginx is listening to the same 80 port as the app (well maybe not, I read too fast and didn’t see the VM part of the problem :sweat_smile: ), using the web.socketed template should solve it (and the use of https).