Jellyfin Forum
Swag Docker config example for jellyfin? - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: General Questions (https://forum.jellyfin.org/f-general-questions)
+--- Thread: Swag Docker config example for jellyfin? (/t-swag-docker-config-example-for-jellyfin)

Pages: 1 2


RE: Swag Docker config example for jellyfin? - TheDreadPirate - 2024-03-27

I just noticed a mistake on one of my prior posts.  Also re-reading the Nginx docs.  I blended your config with our Nginx docs.  There were some weird things with yours.  Make a copy of yours and then replace the original with this.

Code:
server {
    listen 443 ssl;
    listen [::]:443 ssl;
    server_name jellyfin.*;
    include /config/nginx/ssl.conf;
    include /config/nginx/proxy.conf;
    resolver 127.0.0.11 valid=30s;
    client_max_body_size 0;
    set $jellyfin 192.0.0.2
    location / {
        # Proxy main Jellyfin traffic
        proxy_pass http://$jellyfin:8096;
        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-Protocol $scheme;
        proxy_set_header X-Forwarded-Host $http_host;

        # Disable buffering when the nginx proxy gets very resource heavy upon streaming
        proxy_buffering off;
    }

    # location block for /web - This is purely for aesthetics so /web/#!/ works instead of having to go to /web/index.html/#!/
    location = /web/ {
        # Proxy main Jellyfin traffic
        proxy_pass http://$jellyfin:8096/web/index.html;
        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-Protocol $scheme;
        proxy_set_header X-Forwarded-Host $http_host;
    }

    location /socket {
        # Proxy Jellyfin Websockets traffic
        proxy_pass http://$jellyfin:8096;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        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-Protocol $scheme;
        proxy_set_header X-Forwarded-Host $http_host;
    }
}



RE: Swag Docker config example for jellyfin? - revivor - 2024-03-27

I put it in with no reaction. This is current config:



EDIT: "SEE final Script below!"


RE: Swag Docker config example for jellyfin? - TheDreadPirate - 2024-03-27

I'll give it another whack with my test setup and try to get SWAG working there. I'll get back to you, hopefully, by Sunday. I won't have time before then. Unless you figure it out before then.


RE: Swag Docker config example for jellyfin? - revivor - 2024-03-27

I would appreciate it -  was looking and testing for a solution since months.

and if i find something out i will let you know before sunday. thanks


RE: Swag Docker config example for jellyfin? - SenorSmartyPants - 2024-03-27

I use host networking and I've finally got one family member using it offsite. I need to figure out the best way to secure this/authentication. Family member uses a Roku, currently no password, but want to switch to password/pin but not working well on my 10.8.7 install (doesn't ever prompt for pin on local networks).

Here's my swag config.

Quote:server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name jellyfin.* j.*;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    location / {
        include /config/nginx/proxy.conf;
        include /config/nginx/resolver.conf;
        set $upstream_app rockpi;
        set $upstream_port 8096;
        set $upstream_proto http;
        proxy_pass $upstream_protoConfused-face/$upstream_app:$upstream_port;

        proxy_set_header Range $http_range;
        proxy_set_header If-Range $http_if_range;
    }

    location ~ (/jellyfin)?/socket {
        include /config/nginx/proxy.conf;
        include /config/nginx/resolver.conf;
        set $upstream_app rockpi;
        set $upstream_port 8096;
        set $upstream_proto http;
        proxy_pass $upstream_protoConfused-face/$upstream_app:$upstream_port;

    }
}



RE: Swag Docker config example for jellyfin? - TheDreadPirate - 2024-03-27

You need to set a password for the account first. Then it will prompt on the first login. I'm not aware of a way to make it prompt for a PIN for subsequent logins.


RE: Swag Docker config example for jellyfin? - revivor - 2024-03-27

Yeah You Did it really Pirate!!!
I found out why it not worked.

with
docker logs -f swag

I get:

Quote: nginx: [emerg] directive "set" is not terminated by ";" in /config/nginx/site-confs/default.conf:19

it was missing an ";" Upside-down-face 

I put ; at the end of Line 19 and Now This works from you! Thanks a Lot for this script and your patience!!

The FINAL working Script:

Quote:server {

    listen 443 ssl;

    listen [::]:443 ssl;

    server_name jellyfin.*;

    include /config/nginx/ssl.conf;

    include /config/nginx/proxy.conf;

    resolver 127.0.0.11 valid=30s;

    client_max_body_size 0;

    set $jellyfin 192.0.0.2;

    location / {

        # Proxy main Jellyfin traffic

        proxy_pass http://$jellyfin:8096;

        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-Protocol $scheme;

        proxy_set_header X-Forwarded-Host $http_host;



        # Disable buffering when the nginx proxy gets very resource heavy upon streaming

        proxy_buffering off;

    }



    # location block for /web - This is purely for aesthetics so /web/#!/ works instead of having to go to /web/index.html/#!/

    location = /web/ {

        # Proxy main Jellyfin traffic

        proxy_pass http://$jellyfin:8096/web/index.html;

        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-Protocol $scheme;

        proxy_set_header X-Forwarded-Host $http_host;

    }



    location /socket {

        # Proxy Jellyfin Websockets traffic

        proxy_pass http://$jellyfin:8096;

        proxy_http_version 1.1;

        proxy_set_header Upgrade $http_upgrade;

        proxy_set_header Connection "upgrade";

        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-Protocol $scheme;

        proxy_set_header X-Forwarded-Host $http_host;

    }

}