Issue Onebox in HTTPS

We set Nginx has a front-end proxy for discourse docker (with sock Add an offline page to display when Discourse is rebuilding or starting up).
Then we set HTTPS Lets’ Encrypt outside the container (acme.sh) and everything works fine except onebox for internal link.
Onebox is not able to show the preview of internal links. They are as external links

  • HTTPS link

  • Same link in HTTP:

Is there a way to fix this issue?

Is force_ssl checked on site settings?

Obligatory, please share a link to the forum in a support topic.

3 Likes

Do you meen force_https on the admin panel? I can’t find force_ssl on site settings.

https://forum.adunanza.net

1 Like

Yes, and looks like you don’t.

Also, when checking this, if you reverse proxy is badly configured, it’s gonna break your site.

1 Like

Just made a backup, we will try to check the “force_https” setting. Do you confirm that even if discourse runs through sock, and so the “ssl template” is commented out, everything should work fine?
Our reverse proxy is configured to redirect all http traffic to https.

I’m not really a fan of running reverse proxy in self-hosted environments, unless you are very comfortable with your reverse proxy of choice.

That said, if you have all the correct headers set, it will work.

3 Likes

It works perfectly now.
Thanks for the support @Falco.

4 Likes

Which headers would that be?

Here’s what I have:

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 $scheme;                                                                                           
            client_max_body_size 20M;
            error_page 502 =502 /errorpages/offline.html;
            proxy_intercept_errors on;
            error_page 500 503 504 /errorpages/50x.html;
}

This topic was automatically closed after 2660 days. New replies are no longer allowed.