Hi there,
When I type for example “thenameofmywebsite.com” in the browser, it does not forward automatically to secure SSL https.
Where can I change this for discourse? Thank you.
Hi there,
When I type for example “thenameofmywebsite.com” in the browser, it does not forward automatically to secure SSL https.
Where can I change this for discourse? Thank you.
Discord is a different product, I’m assuming you mean Discourse.
How did you configure SSL? How was this instance installed?
If you followed the standard guide then HTTPS redirection works as standard, which suggests that you either installed via a different method, or changed the configuration after installation.
Sorry, typo.
Here is my discourse.conf
server {
if ($host = wolcengame.net) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
listen [::]:80;
server_name wolcengame.net www.wolcengame.net;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name wolcengame.net www.wolcengame.net;
So there is a difference between https://wolcengame.net and www.wolcengame.net . The first link works and load the page, however when clicking on the second it turns into https://www.wolcengame.net and dark screen, nothing is loading.
I have no idea what is wrong and how to fix this.
Remove this part then restart nginx and it should work fine.
I don’t think anything changed. The issue is still there. Any other idea?
That config can be changed in many ways.
Hi Bhanu.
DISCOURSE_HOSTNAME: wolcengame.net
I have another website with the same configuration as my discourse.conf, and there is no similar issue like this one there.
My question is, is there something from discourse that is interfering with the nginx redirection? I tried everything yesterday and I run out of idea to solve this issue.
This is my second website www.koktailmolotov.com . As you see if you click on the website, it redirects automatically to the format https://koktailmolotov.com. The conf settings are the same as for my discourse website.
That’s not possible since all the traffic is handled by external nginx. I’m assuming here that You’re running discourse in socketed template and the external nginx proxy is handling all the traffic.
If You can post nginx configuration for discourse, I may be able to help you figure out the issue.
Below the entire discourse.conf nginx configuration as for today:
server {
listen 80; listen [::]:80; server_name www.wolcengame.net; return 301 $scheme://wolcengame.net$request_uri;
}
server {
listen 443 ssl http2; listen [::]:443 ssl http2; server_name wolcengame.net www.wolcengame.net; ssl on; ssl_certificate /etc/letsencrypt/live/wolcengame.net/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/wolcengame.net/privkey.pem; # managed by Certbot ssl_dhparam /etc/letsencrypt/live/wolcengame.net/dhparams.pem; include /etc/nginx/snippets/ssl.conf; http2_idle_timeout 5m; # up from 3m default 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 https; proxy_set_header X-Real-IP $remote_addr; }
}
Change this to
return 301 https://wolcengame.net$request_uri;
Remove www.wolcengame.net
from this
and create a separate block like
listen 443 ssl;
listen [::]:443 ssl;
server_name www.wolcengame.net;
ssl_certificate /etc/letsencrypt/live/wolcengame.net/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/wolcengame.net/privkey.pem;
return 301 https://wolcengame.net$request_uri;
To be clear this isn’t a discourse issue at all.
Discourse can only operate under one FQDN. The issue is that you had configured two and hadn’t configured your redirects correctly. The solutions to both of these problems were already answered in other topics.
You are genius, this fixed the issue. Thank you very much
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.