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


Swag Docker config example for jellyfin? - revivor - 2024-03-26

Hello,
Can someone post an example for swag docker config files pls? 
I m going insane with this. 
I tried offical config from swag and tried the Nginx config from Jelly-Wiki but nothing works…

I would like to use http Auth with redirect to https


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

Someone posted their SWAG config in the Jellyfin Matrix chat last month. I'll try to track that down, but probably won't have the time to do that until Saturday.

I have a SWAG installed on my test system, but haven't gotten around to figuring out a working config and writing up docs for it yet.


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

Thanks for your Reply! That Chat would be very helpful!

i Found a script for SWAG at the bottom of this site about letsencrypt.

https://jellyfin.org/docs/general/networking/letsencrypt/

It mentioned that this is for subfolder and subdomain installations. i dont use both of them. So which variable has to change for normal domain without sub?


Quote:server {
    listen 443 ssl;
    listen [::]:443 ssl;
    server_name jellyfin.*;
    include /config/nginx/ssl.conf;
    client_max_body_size 0;
    location / {
        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_app jellyfin;
        set $upstream_port 8096;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$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;
        resolver 127.0.0.11 valid=30s;
        set $upstream_app jellyfin;
        set $upstream_port 8096;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $http_connection;
  }
}



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

Code:
location ~ (/jellyfin)?/socket/ {

Is this what you actually have in the SWAG config? It should be

Code:
location ~ (/socket/ {

Also, in your DNS is "jellyfin" resolving to your jellyfin server? Try putting your container/host IP instead of "jellyfin" for the proxy pass.


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

Thanks again!

I ve change into this
but still get "no response"

This my default.conf now:

Quote:server {
    listen 443 ssl;
    listen [::]:443 ssl;
    server_name jellyfin.*;
    include /config/nginx/ssl.conf;
    client_max_body_size 0;
    location / {
        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_app 192.0.0.2;
        set $upstream_port 8096;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;
        proxy_set_header Range $http_range;
        proxy_set_header If-Range $http_if_range;
    }
    location ~ (/socket/ {
        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_app 192.0.0.2;
        set $upstream_port 8096;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $http_connection;
  }
}


what about
Quote:server_name jellyfin.*;

should i change jellyfin here too? Server Name of the Host or the Docker Container Name? My Jellyfin is not on Docker!

My Setup:
`
Libreelec with official Jellyfin Addon and "SWAG Docker Addon" runs on the same host. Only SWAG is in docker.

Maybe Docker Addon don't talk with host? How can i bring them together?

In jellyfin Network Settings is https not active. Only the official Port Entry 8920. Is that correct?


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

(2024-03-27, 05:07 PM)revivor Wrote: what about
Quote:server_name jellyfin.*;


This is the name that the server listens for on port 443.  This is should be fine as is.

(2024-03-27, 05:07 PM)revivor Wrote: should i change jellyfin here too? Server Name of the Host or the Docker Container Name? My Jellyfin is not on Docker!

My Setup:
`
Libreelec with official Jellyfin Addon and "SWAG Docker Addon" runs on the same host. Only SWAG is in docker.

Maybe Docker Addon don't talk with host? How can i bring them together?

In jellyfin Network Settings is https not active. Only the official Port Entry 8920. Is that correct?

Can you share the docker compose for SWAG?  What is the network_mode?


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

I've read this in the commentary of the Script.

Quote:# in jellyfin settings, under "Advanced/Networking" add subdomain.mydomain.tld as a known proxy

what does this mean in my case? only domain name " domain.****.eu " or Container Name of SWAG?

this is my docker script
Quote:docker run -d \
  --name=swag \
  --cap-add=NET_ADMIN \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Europe/London \
  -e URL=domain.****.eu \
  -e VALIDATION=http \
  -e PROPAGATION= #optional \
  -e DHLEVEL=2048 \
  -e ONLY_SUBDOMAINS=false \
  -e STAGING=false\
  -p 443:443 \
  -p 80:80 \
  -v /storage/.config/swag/config:/config \
  --restart unless-stopped \
  lscr.io/linuxserver/swag:latest



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

Docker inspect says

network_mode "default"

Quote:  },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "05",
            "SandboxKey": "/var/run/docker/netns/054f6796f4c4",
            "Ports": {
                "443/tcp": [
                    {
                        "HostIp": "0.0.0.0",
                        "HostPort": "443"
                    },
                    {
                        "HostIp": "::",
                        "HostPort": "443"
                    }
                ],
                "80/tcp": [
                    {
                        "HostIp": "0.0.0.0",
                        "HostPort": "80"
                    },
                    {
                        "HostIp": "::",
                        "HostPort": "80"
                    }
                ]
            },
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "
            "Gateway": "172.17.0.1",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "172.17.0.2",
            "IPPrefixLen": 16,
            "IPv6Gateway": "",
            "MacAddress": "",
            "Networks": {
                "bridge": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "MacAddress": "",
                    "NetworkID": "975a63930bcb89cf32daa65d6bb244b5f73704b2002579b2451e9c753b4e477d",
                    "EndpointID": "a8d8eed550eeeaff45eb4a3dbca7c70c528f5546300a3a31a7abf67b018d1453",
                    "Gateway": "172.17.0.1",
                    "IPAddress": "172.17.0.2",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "DriverOpts": null,
                    "DNSNames": null
                }
            }
        }
    }
]



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

Ah. Not using host networking. You'd have to do additional configuration to allow SWAG to communicate with non-docker services. Or just add "--network host" as one of the parameters so that is uses the same IP and NIC as the host OS and other apps (including Jellyfin). You will need to open port 443 in the host firewall after doing this.

The "Known Proxies" config tells Jellyfin to log the "X-Forwarded-For" field, which would have the original requestor when using a reverse proxy on a different host. Since SWAG and Jellyfin are on the same host, this is not necessary.


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

I've added
--network host \

to the docker script. and recreate the container. At the End I get this message

Quote:WARNING: Published ports are discarded when using host network mode

I've restarted and fill in the same swag config as before.

Now I am at network mode = host

and on my Router I made Portsharing for this "host" on all ports used in Jellyfin and 443.

Quote: You will need to open port 443 in the host firewall after doing this.

How?

Is there something special on libreelec (this is the host) with Port 443?

as I leave SWAG default.conf as it was. I get this message when I enter domain URL:

if i use our config then the other message appears: