diff --git a/docker-compose.yml b/docker-compose.yml index ee25e75..4497850 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -75,7 +75,7 @@ services: image: nginx:alpine volumes: - $VOLDIR/nginx/nginx.cfg:/etc/nginx/conf.d/media.conf - - $VOLDIR/nginx/Muximux:/www + - $VOLDIR/nginx/Organizr:/www restart: always ports: - "80:80" @@ -86,5 +86,5 @@ services: image: php:7.0-fpm-alpine working_dir: /www volumes: - - $VOLDIR/nginx/Muximux:/www + - $VOLDIR/nginx/Organizr:/www diff --git a/nginx.cfg b/nginx.cfg index 884694d..d3b1871 100644 --- a/nginx.cfg +++ b/nginx.cfg @@ -18,22 +18,31 @@ server { fastcgi_param PATH_INFO $fastcgi_path_info; } } + + location /auth-admin { + internal; + rewrite ^ /auth.php?admin; + } + location /auth-user { + internal; + rewrite ^ /auth.php?user; + } location /plex { 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 ^/$ http://$http_host/web/index.html; - } +# # 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 ^/$ http://$http_host/web/index.html; +# } proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; @@ -53,23 +62,28 @@ server { } location /deluge { + auth_request /auth-admin; proxy_pass http://deluge:8112/; proxy_set_header X-Deluge-Base "/deluge/"; } location /sickrage { + auth_request /auth-admin; proxy_pass http://sickrage:8081; } location /nzbget { + auth_request /auth-admin; proxy_pass http://nzbget:6789; } location /plexpy { + auth_request /auth-user; proxy_pass http://plexpy:8181; } location /couchpotato { + auth_request /auth-admin; proxy_pass http://couchpotato:5050; } diff --git a/update.sh b/update.sh index 25c502b..812e423 100644 --- a/update.sh +++ b/update.sh @@ -34,9 +34,9 @@ done [[ ! -a ./docker-compose.yml ]] && echo "Downloading Docker Compose config.." && curl -sSL https://raw.githubusercontent.com/Adam-Ant/media-server-in-a-box/master/docker-compose.yml > ./docker-compose.yml [[ ! -a $VOLDIR/nginx/nginx.cfg ]] && echo "Downloading nginx.cfg..." && curl -sSL https://raw.githubusercontent.com/Adam-Ant/media-server-in-a-box/master/nginx.cfg > $VOLDIR/nginx/nginx.cfg -[[ ! -d $VOLDIR/nginx/Muximux ]] && echo "Downloading Muximix..." && git -C $VOLDIR/nginx clone https://github.com/mescon/Muximux && chown -R 82:82 $VOLDIR/nginx/Muximux +[[ ! -d $VOLDIR/nginx/Organizr ]] && echo "Downloading Organizr..." && git -C $VOLDIR/nginx clone https://github.com/causefx/Organizr && chown -R 82:82 $VOLDIR/nginx/Organizr -cd $VOLDIR/nginx/Muximux/ && git pull +cd $VOLDIR/nginx/Organizr/ && git pull echo "#####################################" echo "# Config and directory struture OK! #"