Ciao, sono di nuovo io ^^.\n\nHo un piccolo problema che credo di aver avuto anche prima, ma potrebbe trattarsi di qualcos’altro ora.\n\nIl problema è il seguente:\n- se apri cp2077.eu nel browser, la pagina dice che è "in manutenzione", che è ovviamente un mio template e non è sicuro.\n\n- ma se apri https://cp2077.eu, appare il forum Discourse e il sito sembra sicuro con SSL.\n\nIl mio sospetto è che il mio file nginx non stia gestendo correttamente il reindirizzamento alla pagina https. Ecco il mio file: l’ho controllato ma non so dove sia il problema, sembra tutto a posto (credo che lo sia), ma forse qualcuno con più esperienza può aiutarmi a risolvere questa questione? Lo apprezzerei molto:\n\n server {\n\n listen 80;\n listen [::]:80;\n server_name www.cp2077.eu;\n return 301 https://cp2077.eu$request_uri;\n }\n\n server {\n\n listen 443 ssl;\n listen [::]:443 ssl;\n server_name www.cp2077.eu;\n ssl_certificate /etc/letsencrypt/live/cp2077.eu/fullchain.pem;\n ssl_certificate_key /etc/letsencrypt/live/cp2077.eu/privkey.pem;\n return 301 https://cp2077.eu$request_uri;\n }\n\n server {\n\n listen 443 ssl http2;\n listen [::]:443 ssl http2;\n server_name cp2077.eu;\n\n ssl on;\n ssl_certificate /etc/letsencrypt/live/cp2077.eu/fullchain.pem;\n ssl_certificate_key /etc/letsencrypt/live/cp2077.eu/privkey.pem;\n\n\n\n http2_idle_timeout 5m; # aumentato dal default di 3m\n\n location / {\n proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock;\n proxy_set_header Host $http_host;\n proxy_http_version 1.1;\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n proxy_set_header X-Forwarded-Proto https;\n proxy_set_header X-Real-IP $remote_addr;\n\n }\n\n }\n\nHai qualche idea su cosa potrei modificare qui per risolvere il problema?
You allow only ẁww..
How can I redirect www and cp2077.eu to be redirected to https?
Try adding the domain.
server_name cp2077.eu www.cp2077.eu;
Tried that before posting, it throws me the following error when running command: nginx -t
nginx: [warn] conflicting server name "cp2077.eu" on 0.0.0.0:443, ignored
nginx: [warn] conflicting server name "cp2077.eu" on [::]:443, ignored
Did you add it only in the first server {} (port 80)?
3 Mi Piace
I added it on both 80 and 443
—Edit.
I just put it on 80 and looks like its working. However now it says that Connection not secure (parts of this page are not secure, such as images)_
You should enable force https in discourse settings.
1 Mi Piace
I will try that. Thank you very much Arkshine
1 Mi Piace
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.