-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplex.domain.ltd.conf
63 lines (46 loc) · 1.98 KB
/
plex.domain.ltd.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
upstream plex_backend {
server 127.0.0.1:32400;
keepalive 32;
}
server {
listen 443 ssl http2;
#include snippets/ssl-plex.DOMAIN.org.conf;
include snippets/ssl-params.conf;
server_name plex.domain.ltd;
ssl_certificate /etc/nginx/ssl/plex.domain.ltd/fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/plex.domain.ltd/key.pem;
gzip on;
gzip_vary on;
gzip_min_length 1000; index index.html index.htm index.php;
gzip_proxied any;
gzip_types text/plain text/css text/xml application/xml text/javascript application/x-javascript image/svg+xml;
gzip_disable "MSIE [1-6]\.";
proxy_set_header Host $host;
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 $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_redirect off;
proxy_buffering off;
location / {
if ($request_method != OPTIONS) {
set $test A;
}
if ($http_x_plex_device_name = '') {
set $test "${test}B";
}
if ($arg_X-Plex-Device-Name = '') {
set $test "${test}C";
}
if ($http_user_agent !~ (SmartTV)) {
set $test "${test}D";
}
if ($test = ABCD) {
rewrite ^/$ $scheme://$http_host/web/index.html;
}
}
proxy_pass http://plex_backend;
}
}