-
Notifications
You must be signed in to change notification settings - Fork 0
/
plexNchill.conf
58 lines (51 loc) · 1.74 KB
/
plexNchill.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
# Easy to modify ports and IP addresses
map $uri $media_port {
~*/web* 32400; # Plex
~*/couchpotato* 5050; # CouchPotato
~*/sonarr* 8989; # Sonarr
~*/radarr* 7878; # Radarr
~*/sabnzbd* 8080; # Sabnzbd
~*/transmission 9091; # Transmission
~*/jackett 9117; # Jackett
default 32400; # Go to plex by default
}
# Uncomment this if each service is running on different servers
# Or edit default if only NGINX and services are on different servers
map $uri $media_ip {
# ~*/web* 127.0.0.1; # Plex
# ~*/couchpotato* 127.0.0.1; # CouchPotato
# ~*/sonarr* 127.0.0.1; # Sonarr
# ~*/radarr* 127.0.0.1; # Radarr
# ~*/sabnzbd* 127.0.0.1; # Sabnzbd
# ~*/transmission 127.0.0.1; # Transmission
# ~*/Jackett 127.0.0.1; # Jackett
default 127.0.0.1; # Go to localhost by default
}
server {
listen 80;
server_name localhost;
root /var/www/html/plexNchill;
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_http_version 1.1;
proxy_set_header Connection "";
location / {
# Use sub_filter to modify the host name within the html
sub_filter 'host.com' $host;
sub_filter_once off;
}
# Set the upstream server dynamically based on URIs
set $upstream_endpoint $media_ip:$media_port;
location ~ /jackett/?$ {
return 301 http://$host/jackett/Admin/Dashboard;
}
location ~ /transmission {
proxy_set_header Authorization "Basic ZXJpYzowOGNvb3BlclM=";
proxy_pass_header X-Transmission-Session-Id;
proxy_pass http://$upstream_endpoint;
}
location ~ /(web|couchpotato|sonarr|radarr|jackett|sabnzbd/){
proxy_pass http://$upstream_endpoint;
}
}