1
0
mirror of https://github.com/navilg/media-stack.git synced 2024-11-21 10:05:46 +02:00

Separate Nginx docker-compose

This commit is contained in:
Navratan Lal Gupta 2022-07-18 18:13:16 +05:30 committed by GitHub
parent a1927d6ebe
commit e4a50f2934
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 188 additions and 16 deletions

23
docker-compose-nginx.yml Normal file
View File

@ -0,0 +1,23 @@
version: '2'
name: nginx
services:
nginx:
image: nginx:1.21.3-alpine
container_name: nginx
networks:
- mynetwork
volumes:
- nginx-config:/etc/nginx
- letsencrypt:/etc/letsencrypt
ports:
- 80:80
- 443:443
restart: unless-stopped
volumes:
nginx-config:
letsencrypt:
networks:
mynetwork:
external: true

View File

@ -88,19 +88,6 @@ services:
- 8920:8920
restart: unless-stopped
nginx:
image: nginx:1.21.3-alpine
container_name: nginx
networks:
- mynetwork
volumes:
- nginx-config:/etc/nginx
- letsencrypt:/etc/letsencrypt
ports:
- 80:80
- 443:443
restart: unless-stopped
volumes:
tx-config:
tx-downloads:
@ -110,8 +97,6 @@ volumes:
jackett-config:
jackett-blackhole:
jellyfin-config:
nginx-config:
letsencrypt:
networks:
mynetwork:

161
nginx.config Normal file
View File

@ -0,0 +1,161 @@
server {
server_name localhost example.com;
#access_log /var/log/nginx/host.access.log main;
# location / {
# root /usr/share/nginx/html;
# index index.html index.htm;
# }
###PROXY-START###
###FLAME-PROXY###
#location / {
# proxy_set_header X-Forwarded-Server $host;
# proxy_set_header X-Forwarded-Host $host;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_pass http://flame:5005;
# proxy_http_version 1.1;
# proxy_pass_request_headers on;
# proxy_set_header Connection "upgrade";
# proxy_store off;
# }
###HEIMDALL-PROXY###
# location / {
# proxy_set_header Host $host;
# proxy_set_header X-Forwarded-Scheme $scheme;
# proxy_set_header X-Forwarded-Proto $scheme;
# proxy_set_header X-Forwarded-For $remote_addr;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_pass https://heimdall;
# }
###RADARR-PROXY###
location /radarr {
proxy_pass http://radarr:7878;
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 Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
}
###JACKETT-PROXY###
location /jackett/ {
proxy_pass http://jackett:9117;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $http_host;
}
###TRANSMISSION-PROXY###
location ^~ /transmission {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_pass_header X-Transmission-Session-Id;
add_header Front-End-Https on;
location /transmission/rpc {
proxy_pass http://transmission:9091;
}
location /transmission/web/ {
proxy_pass http://transmission:9091;
}
location /transmission/upload {
proxy_pass http://transmission:9091;
}
location /transmission {
return 301 https://$host/transmission/web;
}
}
###JELLYFIN-PROXY###
location /jellyfin {
return 302 $scheme://$host/jellyfin/;
}
location /jellyfin/ {
proxy_pass http://jellyfin:8096/jellyfin/;
proxy_pass_request_headers on;
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_set_header X-Forwarded-Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
# Disable buffering when the nginx proxy gets very resource heavy upon streaming
proxy_buffering off;
}
###SONAR_PROXY###
location /sonarr {
proxy_pass http://sonarr:8989;
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 Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
}
###PROXY-END###
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}

View File

@ -4,4 +4,7 @@ docker exec -it transmission mkdir -p /downloads/movies
docker exec -it transmission chown -R 1000:1000 /downloads/movies
docker exec -it transmission mkdir -p /downloads/tvshows
docker exec -it transmission chown -R 1000:1000 /downloads/tvshows
docker exec -it transmission chown -R 1000:1000 /downloads/tvshows
docker ps | grep nginx && docker cp nginx.conf nginx:/etc/nginx/conf.d/default.conf && docker exec -it nginx nginx -s reload