Can't enable DiscourseID on a site with force-https disabled

For context, I have my Discourse test site running in a Proxmox container behind Nginx (npmplus) on a different server on the same network (but not subnet). Not really anything special. I tried enabling force-https but I kept getting a bunch of CSRF validation errors so I just disabled it again because it wasn’t worth a fight. Regardless of any of that, the site works on https fine because Nginx/Cloudflare are both set up for it properly:

I tried enabling DiscorseID on the site just now but was met with an error:


Is there a workaround that doesn’t involve fighting with npmplus for hours to get Discourse CSRF validation to stop complaining about anything? This thread is not for debugging npmplus or SSL, I simply want to fix Discourse ID.

The error message Discourse ID returned is complaining that the site’s Redirect URI must be https, so you need to turn on force_https, or otherwise indicate via your proxy configuration the requests are coming in via https.

Except for everything that doesn’t:

3 likes

Huh, guess I never noticed any of that. As I said, I tried enabling force_https, but I kept getting CSRF errors doing anything. Maybe the normal nginx variables just don’t work on npmplus (according to the instructions that say so right above) then because this is the config I was using:

Besides that port 443 on my CT wasn’t responding so it’s still connecting locally over 80.

You should fix your reverse proxy setup and get proper HTTPS working.

1 like

I think the issue right now is just weirdness with the variables npmplus is exposing. I had a working config before but I lost it and am not really sure what to do at the moment, I settled on the following but don’t want to enable the setting until I’m 100% sure it’ll work to avoid BAD CSRF and a trip to the rails console to fix it yet again.



Interestingly it seems to just be rejecting traffic over 443 which I don’t think is normal even though the proxy is set to 80 at the moment