2024-03-13, 11:50 PM
(This post was last modified: 2024-03-14, 12:01 AM by william-. Edited 1 time in total.)
Hey all! I've got jellyfin and nginx both running in separate containers on the same machine and I'm having a hard time getting nginx to pass requests back to jellyfin properly. I want to be able to access this at apps.home/jellyfin. The initial visit seems to work correctly, but then the redirect to /web/index just keeps redirecting over and over again forever. I have set the base url setting in jellyfin to be "/jellyfin".
I've tried removing the trailing / on proxy_pass http://apps.home:8096;, but then I just get 404 from nginx.
Any thoughts?
I've tried removing the trailing / on proxy_pass http://apps.home:8096;, but then I just get 404 from nginx.
Any thoughts?
server {
listen 80;
server_name apps.home;
location /jellyfin/ {
proxy_pass http://apps.home:8096/;
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;
proxy_buffering off;
}
}
docker run -d \
--name jellyfin \
--user $(id -u):$(id -g) \
-v /mnt/nfs/media/movies:/media/movies \
-v /mnt/nfs/media/shows:/media/shows \
-v /mnt/nfs/media/shorts:/media/shorts \
-v /srv/jellyfin/config:/config \
-v /srv/jellyfin/cache:/cache \
-p 8096:8096 \
jellyfin/jellyfin
docker run -d --name apps-nginx --restart=always -p 80:80 -p 443:443 apps-nginx
FROM nginx:latest
COPY sites-available/ /etc/nginx/sites-available/
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80 443
RUN mkdir -p /etc/nginx/sites-enabled
RUN ln -s /etc/nginx/sites-available/jellyfin.conf /etc/nginx/sites-enabled/
CMD ["nginx", "-g", "daemon off;"]
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" '
'-> $upstream_addr';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-available/*.conf;
}