External nginx proxy and https false error

AI-generated summary

In a discussion about an external nginx proxy causing HTTPS-related issues with Discourse, Dataaja95 initially suspected misconfiguration in their Docker setup, noting that mobile app logins failed and API keys were missing — with Rails console confirming request.ssl? returned false, suggesting HTTPS wasn’t being recognized internally. They shared their app.yml configuration, which included SSL templates and DISCOURSE_FORCE_HTTPS: true, while confirming nginx handled SSL termination externally on the same machine. However, in post 2, Dataaja95 revealed the issue was user error: the affected user had mistakenly installed the Discord mobile app instead of the correct Discourse client, Discourse Hub. After guiding the user to install the proper app, login functionality worked without any server-side changes. Jagster had asked for clarification on the solution, which Dataaja95 provided in post 4. The root cause was client-side confusion, not nginx or Discourse configuration.

hi

I am using an external nginx proxy in front of the discourse basic docker installation, everything else worked great except that mobile app users cannot log in and the api keys are not displayed in the admin control panel. In addition, the rails console gives the command
request = ActionDispatch::Request.new({})
request.ssl? the result is false so apparently the docker internal nginx thinks that http is used instead of https, I have configured app.y like this, is this the correct configuration nginx runs on the same machine as discourse not in docker.

Do you see any obvious errors or shortcomings in the app.yml configuration? External nginx handles certificates and SSL termination.

  • “templates/web.template.yml”

  • “templates/web.ratelimited.template.yml”

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

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

  • “templates/web.socketed.template.yml”
  • #expose:
  • #- “80:80” # http
  • #- “443:443” # https

env:

DISCOURSE_FORCE_HTTPS: true

DISCOURSE_TRUSTED_PROXIES: 127.0.0.1,172.17.0.1

The solution to the problem was simpler than I thought, it was pure user error, so the server is fine.

Would you like to tell what was the solution?

The user had accidentally downloaded the Discord mobile software and tried to log in to Discourse with it. I guided him to download the correct software, Discourse Hub, and he was able to log in to the forum. No adjustments were needed on the server side.