Hello it’s me again ^^.
I have a slight problem that I believe I had before but it could be now something else.
The problem is the following:
-
if you open cp2077.eu on browser, then the page says its “under maintenance” which is a template of mine of course and it’s not secure.
-
but if you open https://cp2077.eu , then the discourse forum appears and the website looks secure with SSL.
My guess is that my nginx file is not taking account redirecting page to https. Here is my file, I have checked but I don’t know where the problem is, it looks fine (I think it looks fine) but maybe someone with more knowledge can help me sort this issue out? I would appreciate:
server {
listen 80;
listen [::]:80;
server_name www.cp2077.eu;
return 301 https://cp2077.eu$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name www.cp2077.eu;
ssl_certificate /etc/letsencrypt/live/cp2077.eu/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/cp2077.eu/privkey.pem;
return 301 https://cp2077.eu$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name cp2077.eu;
ssl on;
ssl_certificate /etc/letsencrypt/live/cp2077.eu/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/cp2077.eu/privkey.pem;
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;
}
}
Any clue what could I change here to resolve it?