129 lines
4.1 KiB
Plaintext
129 lines
4.1 KiB
Plaintext
# /etc/nginx/sites-available/nik4nao.home.arpa
|
||
|
||
# WebSocket upgrade helper (for Jellyfin)
|
||
map $http_upgrade $connection_upgrade {
|
||
default upgrade;
|
||
'' close;
|
||
}
|
||
|
||
server {
|
||
listen 80;
|
||
server_name nik4nao.home.arpa;
|
||
|
||
access_log off;
|
||
error_log /var/log/nginx/nik4naohomearpa_error.log warn;
|
||
|
||
# ---- Convenience redirects ----
|
||
location = / { return 302 /admin/; } # land on Pi-hole admin by default
|
||
location = /pihole { return 302 /admin/; } # /pihole -> /admin/
|
||
location /pihole/ { return 301 /admin/; } # keep only /admin/ path
|
||
|
||
# ---- Jellyfin at /jellyfin/ ----
|
||
location = /jellyfin { return 302 /jellyfin/; } # enforce trailing slash
|
||
|
||
location /jellyfin/ {
|
||
proxy_pass http://jellyfin_upstream/; # uses upstream (or use the raw URL)
|
||
include snippets/proxy-common.conf;
|
||
|
||
# Jellyfin behind subpath specifics
|
||
proxy_set_header Upgrade $http_upgrade;
|
||
proxy_set_header Connection $connection_upgrade;
|
||
proxy_set_header X-Forwarded-Host $host;
|
||
proxy_set_header X-Forwarded-Prefix /jellyfin;
|
||
|
||
# (Optional) if you see odd redirects, uncomment:
|
||
# proxy_redirect off;
|
||
}
|
||
|
||
# ---- Jellyfin at /anime/ ----
|
||
location = /anime { return 302 /anime/; } # enforce trailing slash
|
||
|
||
location /anime/ {
|
||
proxy_pass http://djellyfin_upstream/; # uses upstream (or use the raw URL)
|
||
proxy_next_upstream error timeout invalid_header http_502 http_503 http_504;
|
||
include snippets/proxy-common.conf;
|
||
|
||
# Jellyfin behind subpath specifics
|
||
proxy_set_header Upgrade $http_upgrade;
|
||
proxy_set_header Connection $connection_upgrade;
|
||
proxy_set_header X-Forwarded-Host $host;
|
||
proxy_set_header X-Forwarded-Prefix /anime;
|
||
|
||
# (Optional) if you see odd redirects, uncomment:
|
||
# proxy_redirect off;
|
||
}
|
||
|
||
# ---- Pi-hole admin at /admin/ ----
|
||
# Pi-hole’s UI lives under /admin/, so keep the trailing slash in proxy_pass.
|
||
location /admin/ {
|
||
proxy_pass http://pihole_upstream/admin/;
|
||
include snippets/proxy-common.conf;
|
||
proxy_set_header X-Forwarded-Host $host;
|
||
}
|
||
|
||
# Pi-hole API (some UI calls hit /api/)
|
||
location /api/ {
|
||
proxy_pass http://pihole_upstream/api/;
|
||
include snippets/proxy-common.conf;
|
||
proxy_set_header X-Forwarded-Host $host;
|
||
}
|
||
|
||
# redirect /watch-party -> /watch-party/
|
||
location = /watch-party { return 302 /watch-party/; }
|
||
|
||
# proxy ONLY /watch-party/*, keeping the prefix
|
||
location ^~ /watch-party/ {
|
||
proxy_pass http://watchparty_upstream; # ← no trailing slash (preserve /watch-party)
|
||
include snippets/proxy-common.conf;
|
||
|
||
proxy_set_header X-Forwarded-Host $host;
|
||
proxy_set_header X-Forwarded-Prefix /watch-party;
|
||
|
||
# For Vite HMR / websockets
|
||
proxy_set_header Upgrade $http_upgrade;
|
||
proxy_set_header Connection $connection_upgrade;
|
||
}
|
||
|
||
# ---- qBittorrent at /qbt/ ----
|
||
location = /qbt { return 302 /qbt/; }
|
||
|
||
location ^~ /qbt/ {
|
||
proxy_pass http://qbt_upstream/;
|
||
|
||
include snippets/proxy-common.conf;
|
||
|
||
proxy_set_header Host $host;
|
||
proxy_set_header X-Forwarded-Host $host;
|
||
proxy_set_header X-Forwarded-Proto $scheme;
|
||
proxy_set_header X-Forwarded-Prefix /qbt;
|
||
|
||
proxy_cookie_path / /qbt/;
|
||
|
||
proxy_redirect / /qbt/;
|
||
}
|
||
|
||
# ---- JDownloader2 at /jd2/ ----
|
||
location = /jd2 { return 302 /jd2/; }
|
||
|
||
location /jd2/ {
|
||
proxy_pass http://127.0.0.1:5800/;
|
||
include snippets/proxy-common.conf;
|
||
|
||
proxy_set_header X-Forwarded-Host $host;
|
||
proxy_set_header X-Forwarded-Host $host;
|
||
proxy_set_header X-Forwarded-Proto $scheme;
|
||
proxy_set_header X-Forwarded-Prefix /jd2;
|
||
}
|
||
|
||
# ---- JDownloader-Bridge at /jd-bridge/ ----
|
||
location = /jd-bridge { return 302 /jd-bridge/; }
|
||
|
||
location /jd-bridge/ {
|
||
proxy_pass http://127.0.0.1:8088/;
|
||
include snippets/proxy-common.conf;
|
||
|
||
proxy_set_header X-Forwarded-Host $host;
|
||
proxy_set_header X-Forwarded-Prefix /jd-bridge;
|
||
}
|
||
}
|