mirror of
https://github.com/Adam-Ant/media-server-in-a-box
synced 2024-11-08 21:46:23 +00:00
Initial additions for reverse proxy
This commit is contained in:
parent
71fcfa972f
commit
593cc41489
@ -1,9 +1,11 @@
|
||||
# Media Server in a box
|
||||
|
||||
A script and accompanying docker-compose file to go from a bare Docker install to a ready to be configured media server in seconds. Write up to follow.
|
||||
A script and accompanying docker-compose file to go from a bare Docker install to a ready to be configured media server in seconds. Write up to follow.
|
||||
|
||||
**This Version uses a reverse proxy and requires DNS configuration**
|
||||
|
||||
## One liner to get started:
|
||||
|
||||
*Note: This needs to be run as root*
|
||||
|
||||
``` curl -sSL https://raw.githubusercontent.com/Adam-Ant/media-server-in-a-box/master/start.sh | bash ```
|
||||
``` curl -sSL https://raw.githubusercontent.com/Adam-Ant/media-server-in-a-box/proxy/start.sh | bash ```
|
||||
|
@ -14,8 +14,6 @@ services:
|
||||
- data
|
||||
- container:media
|
||||
restart: always
|
||||
ports:
|
||||
- "6789:6789"
|
||||
|
||||
deluge:
|
||||
image: adamant/deluge
|
||||
@ -25,11 +23,6 @@ services:
|
||||
- data
|
||||
- container:media
|
||||
restart: always
|
||||
ports:
|
||||
- "8112:8112"
|
||||
- "58846:58846"
|
||||
- "53160:53160"
|
||||
- "53160:53160/udp"
|
||||
|
||||
sickrage:
|
||||
image: adamant/sickrage
|
||||
@ -40,8 +33,6 @@ services:
|
||||
- data
|
||||
- container:media
|
||||
restart: always
|
||||
ports:
|
||||
- "8081:8081"
|
||||
|
||||
couchpotato:
|
||||
image: adamant/couchpotato
|
||||
@ -52,8 +43,6 @@ services:
|
||||
- data
|
||||
- container:media
|
||||
restart: always
|
||||
ports:
|
||||
- "5050:5050"
|
||||
|
||||
headphones:
|
||||
image: adamant/headphones
|
||||
@ -64,8 +53,6 @@ services:
|
||||
- data
|
||||
- container:media
|
||||
restart: always
|
||||
ports:
|
||||
- "8181:8181"
|
||||
|
||||
plex:
|
||||
image: adamant/alpine-plex
|
||||
@ -88,5 +75,11 @@ services:
|
||||
volumes_from:
|
||||
- data
|
||||
restart: always
|
||||
|
||||
web:
|
||||
image: nginx:alpine
|
||||
volumes:
|
||||
- $VOLDIR/launcher/nginx.cfg:/etc/nginx/conf.d/media.cfg
|
||||
restart: always
|
||||
ports:
|
||||
- "8182:8181"
|
||||
- "80:80"
|
||||
|
86
nginx.cfg
Normal file
86
nginx.cfg
Normal file
@ -0,0 +1,86 @@
|
||||
resolver 127.0.0.1;
|
||||
server {
|
||||
listen 80;
|
||||
server_name genie;
|
||||
|
||||
location / {
|
||||
set $test "";
|
||||
|
||||
# If a request to / comes in, 301 redirect to the main plex page,
|
||||
# but only if it doesn't contain the X-Plex-Device-Name header or query argument.
|
||||
# This fixes a bug where you get permission issues when accessing the web dashboard.
|
||||
if ($http_x_plex_device_name = '') {
|
||||
set $test A;
|
||||
}
|
||||
if ($arg_X-Plex-Device-Name = '') {
|
||||
set $test "${test}B";
|
||||
}
|
||||
if ($test = AB) {
|
||||
rewrite ^/$ https://$http_host/web/index.html;
|
||||
}
|
||||
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
proxy_pass https://genie:32400;
|
||||
|
||||
# Plex proxy settings.
|
||||
proxy_redirect off;
|
||||
proxy_buffering off;
|
||||
|
||||
## Required for Websockets
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_read_timeout 36000s; ## Timeout after 10 hours
|
||||
}
|
||||
}
|
||||
server {
|
||||
listen 80;
|
||||
server_name deluge.genie;
|
||||
|
||||
location / {
|
||||
proxy_pass http://deluge:8112;
|
||||
}
|
||||
}
|
||||
server {
|
||||
listen 80;
|
||||
server_name sickrage.genie;
|
||||
|
||||
location / {
|
||||
proxy_pass https://sickrage:8081;
|
||||
}
|
||||
}
|
||||
server {
|
||||
listen 80;
|
||||
server_name nzbget.genie;
|
||||
|
||||
location / {
|
||||
proxy_pass https://nzbget:6791;
|
||||
}
|
||||
}
|
||||
server {
|
||||
listen 80;
|
||||
server_name plexpy.genie;
|
||||
|
||||
location / {
|
||||
proxy_pass http://plexpy:8181;
|
||||
}
|
||||
}
|
||||
server {
|
||||
listen 80;
|
||||
server_name couchpotato.genie;
|
||||
|
||||
location / {
|
||||
proxy_pass http://couchpotato:5050;
|
||||
}
|
||||
}
|
||||
server {
|
||||
listen 80;
|
||||
server_name headphones.genie;
|
||||
|
||||
location / {
|
||||
proxy_pass http://headphones:8181;
|
||||
}
|
||||
}
|
4
start.sh
4
start.sh
@ -28,6 +28,8 @@ for ((i=0; i<$slen; i++)); do
|
||||
[[ $( ls -dn $VOLDIR/${SERVICES[$i]} | awk '{print $3}') != ${SERVICEUID[$i]} ]] && echo "Chowning $VOLDIR/${SERVICES[$i]} to user ${SERVICEUID[$i]}" && chown ${SERVICEUID[$i]}:${SERVICEUID[$i]} $VOLDIR/${SERVICES[$i]}
|
||||
done
|
||||
|
||||
[[ ! -a $VOLDIR/launcher/docker-compose.yml ]] && echo "Downloading docker-compose.yml.." && curl -sSL https://raw.githubusercontent.com/Adam-Ant/media-server-in-a-box/master/docker-compose.yml > $VOLDIR/launcher/media-compose.yml
|
||||
[[ ! -a $VOLDIR/launcher/docker-compose.yml ]] && echo "Downloading docker-compose.yml.." && curl -sSL https://raw.githubusercontent.com/Adam-Ant/media-server-in-a-box/proxy/docker-compose.yml > $VOLDIR/launcher/media-compose.yml
|
||||
[[ ! -a $VOLDIR/launcher/nginx.cfg ]] && echo "Downloading nginx.cfg..." && curl -sSL https://raw.githubusercontent.com/Adam-Ant/media-server-in-a-box/proxy/nginx.cfg > $VOLDIR/launcher/nginx.cfg
|
||||
|
||||
echo "Starting services..."
|
||||
exec docker-compose -p media -f $VOLDIR/launcher/media-compose.yml up -d
|
||||
|
Loading…
Reference in New Issue
Block a user