It is off. X-Forwarded-Proto is in my server block. So, the only element(s) I am not employing – based on the links that you have all shared – is this:
# base templates used; can cut down to include less functionality per container templates: # - "templates/cron.template.yml" # cron is now included in base image - "templates/postgres.template.yml" - "templates/redis.template.yml" - "templates/sshd.template.yml" - "templates/web.template.yml" # - "templates/web.ssl.template.yml" # remove - https will be handled by outer nginx - "templates/web.ratelimited.template.yml" - "templates/web.socketed.template.yml" # <-- Added # which ports to expose? # expose: comment out entire section
Hell didn’t break lose here. One potential issue is that your emails still contain the http:// link
However, I was properly redirected to https site for activating my account and I don’t see any SSL related errors here.
So Yeah, I’m 99% sure your force_https is not enabled or something is very very wrong with your install that is causing this.
That’s where You’re wrong. If force https is enabled, discourse must send out all links as https. every single link related to the forum must be loaded over https. if you’re still doing weird things and not doing it the suggested way, you’re on your own. We can’t help past the standard procedures that work.
That doesn’t make much sense to me. If we logically break this down I am essentially doing exactly what force-https is meant to do but with the server block.
force_https isn’t merely a rewrite. it does more than that internally. If you want your issues resolved, A solution has been already provided. If you reject the solution, feel free to take matter in your own hands and explore new avenues.
that’s because of your flaky reverse proxy. You’ll have to figure out what is wrong and do things the proper way. We can’t provide assistance with your own solutions.
All of the “solutions” that have been presented do not fit my specific use case:
Remote server (within the same network) – I believe all the examples assume Nginx is running on the same server as Discourse, I am using proxy_pass to hit another internal IP
Why have I done this? Higher security and dispersal of resources. It’s the same reason I split up services in two ways: by container and VM. The suggested docs seem to favour a condition where all services are running on the same server.
I would imagine that the conditions described above would be fairly common. If any of those can be used to accommodate a proxy_pass condition I am more than happy to augment my settings to suit. I just feel that providing a blanket “you’re on your own statement” because I am trying to avoid a ‘putting all my eggs in one basket’ scenario is a little unwarranted.
That’s your preference, I wrote it as an example. You can also choose to expose 80.
There is no benefit or sense in enabling ssl on a local network
That has to exist.
server {
listen 80;
server_name discourse.example.com;
return 301 https://example.com$request_uri;
}
That’s exactly what’s happening, You’re forwarding all requests being received by your proxy/ingress to an internal backend on port 8080 (i.e. discourse)
Answered in #1 it was a personal preference, feel free to use whichever port you fancy.
You particularly don’t need anything that has to do with sockets or ssl on the internal server. SSL should be properly terminated on the reverse-proxy.
NB: most of it is a personal preference based on deployment for customers.
The behaviour I am experience is under those conditions above.
Beginning of app.yml looks like this:
## this is the all-in-one, standalone Discourse Docker container template ## ## After making changes to this file, you MUST rebuild ## /var/discourse/launcher rebuild app ## ## BE *VERY* CAREFUL WHEN EDITING! ## YAML FILES ARE SUPER SUPER SENSITIVE TO MISTAKES IN WHITESPACE OR ALIGNMENT! ## visit http://www.yamllint.com/ to validate this file as needed
templates: - "templates/postgres.template.yml" - "templates/redis.template.yml" - "templates/web.template.yml" - "templates/web.ratelimited.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 - "443:443" # https
## Set db_shared_buffers to a max of 25% of the total memory. ## will be set automatically by bootstrap based on detected RAM, or you can override db_shared_buffers: "1024MB"
## can improve sorting performance, but adds memory usage per-connection #db_work_mem: "40MB"
## Which Git revision should this container use? (default: tests-passed) #version: tests-passed
You are connecting to port 80 on the second nginx, so it thinks you’re connecting to http and not https.
Try to find the X-Forwarded-Proto in the inner nginx and change proxy_set_header X-Forwarded-Proto $thescheme; to proxy_set_header X-Forwarded-Proto https;
or forward your traffic to https proxy_pass https://192.168.86.108