-
Notifications
You must be signed in to change notification settings - Fork 0
/
tautulli.yourdomain.com.conf
75 lines (73 loc) · 3.54 KB
/
tautulli.yourdomain.com.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# https://github.com/Tautulli/Tautulli/wiki/Frequently-Asked-Questions#general-q10
# Port 80 block, redirects http www and non www. to https
server {
listen 80;
server_name www.tautulli.yourdomain.com tautulli.yourdomain.com;
# Logging & Action
return 301 https://www.tautulli.yourdomain.com$request_uri;
access_log /var/log/nginx/tautulli.yourdomain.com.log;
}
# Port 443 ssl block, redirects non www to https www
server {
listen 443 ssl;
server_name tautulli.yourdomain.com;
# SSL Settings
ssl_certificate /etc/letsencrypt/live/www.tautulli.yourdomain.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/www.tautulli.yourdomain.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
ssl_stapling on;
ssl_stapling_verify on;
ssl_trusted_certificate /etc/letsencrypt/live/www.tautulli.yourdomain.com/fullchain.pem;
resolver 1.1.1.1 1.0.0.1;
# Security Headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin" always;
add_header Permissions-Policy "geolocation=(),midi=(),microphone=(),camera=(),magnetometer=(),gyroscope=(),fullscreen=(self),payment=()" always;
add_header Strict-Transport-Security "max-age=31536000" always;
add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive" always;
# Logging & Action
return 301 https://www.tautulli.yourdomain.com$request_uri;
access_log /var/log/nginx/tautulli.yourdomain.com.log;
}
# Port 443 ssl block, handles actual requests
server {
listen 443 ssl; # managed by Certbot
server_name www.tautulli.yourdomain.com;
# SSL Settings
ssl_certificate /etc/letsencrypt/live/www.tautulli.yourdomain.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/www.tautulli.yourdomain.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
ssl_stapling on;
ssl_stapling_verify on;
ssl_trusted_certificate /etc/letsencrypt/live/www.tautulli.yourdomain.com/fullchain.pem;
resolver 1.1.1.1 1.0.0.1;
# Security Headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin" always;
add_header Permissions-Policy "geolocation=(),midi=(),microphone=(),camera=(),magnetometer=(),gyroscope=(),fullscreen=(self),payment=()" always;
add_header Strict-Transport-Security "max-age=31536000" always;
add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive" always;
access_log /var/log/nginx/tautulli.yourdomain.com.log;
# Proxy Pass
location / {
proxy_pass http://127.0.0.1:8181/;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 90;
proxy_set_header X-Forwarded-Proto $scheme;
set $xforwardedssl "off";
if ($scheme = https) {
set $xforwardedssl "on";
}
proxy_set_header X-Forwarded-Ssl $xforwardedssl;
proxy_redirect ~^(http(?:s)?://)([^:/]+)(?::\d+)?(/.*)?$ $1$2:$server_port$3;
}
}