-
Notifications
You must be signed in to change notification settings - Fork 5
/
hass_nginx.conf
45 lines (41 loc) · 1.69 KB
/
hass_nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
map $http_upgrade $connection_upgrade {
'' 'close';
default 'upgrade';
}
server {
listen [::]:80;
listen 80;
server_name #mettere nome dominio;
rewrite ^ https://$host$request_uri? permanent;
}
server {
listen [::]:443 ssl http2;
listen 443 ssl http2;
server_name #mettere nome dominio;
#<eliminare dopo aver creato i certificati># ssl_certificate /etc/letsencrypt/live/#mettere nome dominio/fullchain.pem;
#<eliminare dopo aver creato i certificati># ssl_certificate_key /etc/letsencrypt/live/#mettere nome dominio/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA512:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:ECDH+AESGCM:ECDH+AES256:DH+AESGCM:DH+AES256:RSA+AESGCM:!aNUL$;
ssl_session_cache shared:TLS:2m;
ssl_buffer_size 4k;
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeout 5s;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
location / {
rewrite /(.*) /$1 break;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_pass http://ip:porta;
proxy_set_header Host $host;
proxy_redirect http://ip:porta /;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
}
}