summaryrefslogtreecommitdiffstats
path: root/modules/tozt/files/nginx/headscale-tls.conf
blob: 357c38bbf44095244ab071a012ee1afb8c72edeb (plain) (blame)
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
map $http_upgrade $connection_upgrade {
    default      keep-alive;
    'websocket'  upgrade;
    ''           close;
}

server {
    listen       443 ssl http2;
    listen       [::]:443 ssl http2;
    server_name  headscale.tozt.net;

    access_log  /var/log/nginx/headscale.access.log;
    error_log   /var/log/nginx/headscale.error.log;

    include ssl;

    location / {
        proxy_pass http://127.0.0.1:8081;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        proxy_set_header Host $server_name;
        proxy_buffering off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
        add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always;
    }
}
# vim:ft=nginx