…e web.socketed.template entra ![]()
Questa mi lascia perplesso… Ho un discorso https apparentemente perfetto, tranne per certificate.svg che non si carica. (errore 500, non è un bug, è sicuramente la mia configurazione
)
- Uso web.socketed.template e gestisco SSL al di fuori del contenitore (quindi web.ssl.template è ancora commentato in app.yml)
- Il log di rails dice:
Failed to process hijacked response correctly : Failed to open TCP connection to my.domain:443 (Connection refused - connect(2) for "my.domain" port 443)
Sono entrato nel contenitore per vedere cosa c’è in /etc/nginx/conf.d/discourse.conf; come previsto, non ho visto alcun blocco https (che sarebbe apparso se web.ssl.template fosse stato abilitato, credo).
È possibile che questa parte di web.socketed.template:
- replace:
filename: "/etc/nginx/conf.d/discourse.conf"
from: /listen 443 ssl http2;/
to: |
listen unix:/shared/nginx.https.sock ssl http2;
set_real_ip_from unix:;
non sia stata applicata perché web.ssl.template non è abilitato e in qualche modo fa fallire l’hijack?
Ma perché solo per il certificato di discobot? L’hijack non viene usato spesso, ad esempio per oneboxing? Arg… Sono ai limiti delle mie conoscenze, mi fa male la testa ![]()
ps. lo snippet ssl
ssl_dhparam /etc/ssl/certs/dhparam.pem;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:1m;
ssl_session_tickets off;
ssl_ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers off;
add_header Strict-Transport-Security 'max-age=31536000';
e il blocco nginx
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name my.domain;
ssl on;
ssl_certificate /etc/letsencrypt/live/my.domain/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/my.domain/privkey.pem;
include /etc/nginx/snippets/ssl.conf;
client_max_body_size 0;
http2_idle_timeout 5m;
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-Proto https;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
}