Issue Onebox in HTTPS


(Daniela) #1

We set Nginx has a front-end proxy for discourse docker (with sock Adding an offline page when rebuilding).
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?


Avatar errors in admin/log
(Rafael dos Santos Silva) #2

Is force_ssl checked on site settings?

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


(Daniela) #3

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


(Rafael dos Santos Silva) #4

Yes, and looks like you don’t.

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


(Daniela) #5

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.


(Rafael dos Santos Silva) #6

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.


(Daniela) #7

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


(Christoph) #9

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;
}