# Jellyfin + https + nginx setting up

**URL:** https://dietpi.com/forum/t/jellyfin-https-nginx-setting-up/5127
**Category:** General Discussion
**Created:** [18 March 2021 11:25 UTC](https://dietpi.com/forum/t/jellyfin-https-nginx-setting-up/5127 "2021-03-18T11:25:36Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![fernandog](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/f/c77e96/32.png) [@fernandog](https://dietpi.com/forum/u/fernandog)
#### Post date: [18 March 2021 11:25 UTC](https://dietpi.com/forum/t/jellyfin-https-nginx-setting-up/5127/1 "2021-03-18T11:25:36Z")

</div>

Hello. Almost totally noob here.

Rapsberry Pi 4 8GB.

Now I have a setup with nextcloud(https using letsencrypt as per Joulinar guide in this forum) + Sonarr + Radarr + Bazarr + Jackett + qBitTorret + PiVPN + Jellyfin. Everything is working fine.

However, I’d like to access Jellyfin from outside my home.

I ready read forum posts like

[https://dietpi.com/forum/t/enabling-https-on-jellyfin/4494/4](https://dietpi.com/forum/t/enabling-https-on-jellyfin/4494/4)  
[https://dietpi.com/forum/t/one-letsencrypt-certificate-for-all-installed-applications/4886/1](https://dietpi.com/forum/t/one-letsencrypt-certificate-for-all-installed-applications/4886/1)

and some tutorials, blog posts, etc .

After the research I guess my first step is change my default web server from lighttpd to nginx, but dietpi-software indicates that I can’t without unistalling all the web applications.

So, I’m stuck. How should I proceed? Maybe using the ngixproxymanager docker container that Joulinar pointed in his post? Can this get along with my installation?

And, could you please point me to a noob guide to get all this working?

Thank you in advance

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [18 March 2021 13:59 UTC](https://dietpi.com/forum/t/jellyfin-https-nginx-setting-up/5127/2 "2021-03-18T13:59:25Z")

</div>

Hi,

there will be no easy to go like a noob, give me all commands and I will copy them into command line, solutions 😉

There are a couple of decisions to be done. And you would need to decide what will best for you.

Looking to your applications, Sonarr + Radarr + Bazarr + Jackett + qBitTorret, all running own web server and are not depending on Lighttpd or Nginx. Means they are not impacted. If I understood correctly, it’s not planned to make them available and accessible from the internet.

PiVPN is not a web server application. It’s a VPN server and not impacted at all.

This will left us with Nextcloud and Jellyfin. Depending on the amount of data and configuration already done, it might be a possible way to re-setup both from scratch on Nginx. But this would be up to you to decide.

If it is not possible to reinstall Nextcloud and Jellyfin, you could install Nginx next to Lighttpd. Would be something to test how letsencrypt is behaving if both are installed 🤔

NginxProxyManager would be an easy way to mange multiple SSL certificates and sites to be available from internet. It’s quite a heavy solution as you need docker + database. It might be a little bit oversized if you like to access Nextcloud + Jellyfin only.

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [18 March 2021 16:32 UTC](https://dietpi.com/forum/t/jellyfin-https-nginx-setting-up/5127/3 "2021-03-18T16:32:24Z")

</div>

A reverse proxy can btw as easily be added with Apache2 or Lighttpd:  
E.g. for Apache2 to access via your.IP/jellyfin:

```nohighlight
a2enmod proxy
cat << 'EOF' > /etc/apache2/sites-available/jellyfin.conf
ProxyPass /jellyfin http://127.0.0.1:8096/
ProxyPassReverse /jellyfin http://127.0.0.1:8096/
EOF
a2ensite jellyfin
systemctl restart apache2

```

Lighttpd:

```nohighlight
lighty-enable-mod proxy
cat << 'EOF' > /etc/lighttpd/conf-available/99-jellyfin.conf
$HTTP["url"] =~ "^/jellyfin" {
    proxy.header = ( "map-urlpath" => ( "/jellyfin" => "/" ) )
    proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => 8096 ) ) )
}
EOF
lighty-enable-mod jellyfin
systemctl restart lighttpd

```

We need to add this to our docs 🙂: [https://github.com/MichaIng/DietPi-Docs/issues/404](https://github.com/MichaIng/DietPi-Docs/issues/404)

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [18 March 2021 16:37 UTC](https://dietpi.com/forum/t/jellyfin-https-nginx-setting-up/5127/4 "2021-03-18T16:37:04Z")

</div>

probably we need a section for all 3 web server on this revers proxy topic. 🤔

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [18 March 2021 16:41 UTC](https://dietpi.com/forum/t/jellyfin-https-nginx-setting-up/5127/5 "2021-03-18T16:41:08Z")

</div>

Either that or a reverse proxy tab or each webservers documentation. But actually I like your combined idea more as it can then be easily linked from every web applications section that runs on its own port.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [18 March 2021 16:46 UTC](https://dietpi.com/forum/t/jellyfin-https-nginx-setting-up/5127/6 "2021-03-18T16:46:22Z")

</div>

yeah but I’m totally noob if it comes down to revers proxy config 🙄  
Always struggling with it

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [18 March 2021 17:16 UTC](https://dietpi.com/forum/t/jellyfin-https-nginx-setting-up/5127/7 "2021-03-18T17:16:53Z")

</div>

Apache2 makes it very easy and intuitive, as mostly, but on Lighttpd I forgot the need for (and just added) the path mapping so that it’s not proxied to 127.0.0.1:8096/jellyfin. While Apache2 was not designed as proxy in the first place, like Nginx, and probably does not achieve same performance on high loads, I love it’s very simple and clean syntax 🙂.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [18 March 2021 23:50 UTC](https://dietpi.com/forum/t/jellyfin-https-nginx-setting-up/5127/8 "2021-03-18T23:50:55Z")

</div>

some small corrections related to what MichaIng proposed

create config file as follow. Path is conf-available and not mods-available

```nohighlight
cat << 'EOF' > /etc/lighttpd/conf-available/99-jellyfin.conf
$HTTP["url"] =~ "^/jellyfin" {
    proxy.header = ( "map-urlpath" => ( "/jellyfin" => "/" ) )
    proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => 8096 ) ) )
}
EOF

```

activate setting

```nohighlight
lighty-enable-mod proxy
lighty-enable-mod jellyfin
systemctl restart lighttpd

```

MichaIng  
I end up with the following. Maybe it is not that simple 🤔

 ![picture.PNG](https://dietpi.com/forum/uploads/default/original/2X/b/ba6700530b4a6ad6b12f439b3902d9923283604f.png)

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [19 March 2021 08:41 UTC](https://dietpi.com/forum/t/jellyfin-https-nginx-setting-up/5127/9 "2021-03-19T08:41:33Z")

</div>

So the Jellyfin UI is reached at least, but it seems to have internal issues with the proxy. Does it work OOTB with Nginx?

There are some other options: [https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs\_ModProxy](https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModProxy)  
Probably adding the X-Forwarded-For ans X-Forwarded-Proto helps, which AFAIK is done by default by Nginx and Apache2.  
EDIT: Apache2 adds X-Forwarded-Server as well.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [20 March 2021 08:42 UTC](https://dietpi.com/forum/t/jellyfin-https-nginx-setting-up/5127/10 "2021-03-20T08:42:57Z")

</div>

need to run some test on weekend.

---

<div class="post-metadata">

### Author: ![alleyu2](https://dietpi.com/forum/user_avatar/dietpi.com/alleyu2/32/2097_2.png) [@alleyu2](https://dietpi.com/forum/u/alleyu2)
#### Post date: [1 February 2022 16:52 UTC](https://dietpi.com/forum/t/jellyfin-https-nginx-setting-up/5127/11 "2022-02-01T16:52:51Z")

</div>

Following up on this. Did anyone get this to work with lighttpd?

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [1 February 2022 16:56 UTC](https://dietpi.com/forum/t/jellyfin-https-nginx-setting-up/5127/12 "2022-02-01T16:56:30Z")

</div>

did you tried this solution for lighttpd

[https://dietpi.com/forum/t/jellyfin-https-nginx-setting-up/5127/3](https://dietpi.com/forum/t/jellyfin-https-nginx-setting-up/5127/3)

---

<div class="post-metadata">

### Author: ![alleyu2](https://dietpi.com/forum/user_avatar/dietpi.com/alleyu2/32/2097_2.png) [@alleyu2](https://dietpi.com/forum/u/alleyu2)
#### Post date: [2 February 2022 06:12 UTC](https://dietpi.com/forum/t/jellyfin-https-nginx-setting-up/5127/13 "2022-02-02T06:12:55Z")

</div>

> [@](#):
>
> did you tried this solution for lighttpd
> 
> [Jellyfin + https + nginx setting up - #3 by MichaIng](https://dietpi.com/forum/t/jellyfin-https-nginx-setting-up/5127/3)

Yes, it did work to some extent. Now I am getting the following error. The issue must be with X-Forward but I don’t know how to set it up in Lighttpd.

Here is the solution for nginx. [https://jellyfin.org/docs/general/networking/nginx.html](https://jellyfin.org/docs/general/networking/nginx.html)

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [2 February 2022 13:39 UTC](https://dietpi.com/forum/t/jellyfin-https-nginx-setting-up/5127/14 "2022-02-02T13:39:15Z")

</div>

ah right we had the same issue but did not find a solution. Unfortunately lighttpd is not the best choice to run a revers proxy.

I guess something like the socket would need to be forward as well, looking to the other proxy configuration  
  
  
EDIT: I played with it and at least I got it working for myself if I set a base URL /jellyfin inside Jellyfin configuration panel. That’s within the network section.

lighttpd config file is like this.

```nohighlight
root@DietPiVM-H:~# cat /etc/lighttpd/conf-available/99-jellyfin.conf
$HTTP["url"] =~ "^/jellyfin" {
        proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => 8096 ) ) )
}root@DietPiVM-H:~#

```

---

<div class="post-metadata">

### Author: ![alleyu2](https://dietpi.com/forum/user_avatar/dietpi.com/alleyu2/32/2097_2.png) [@alleyu2](https://dietpi.com/forum/u/alleyu2)
#### Post date: [2 February 2022 14:53 UTC](https://dietpi.com/forum/t/jellyfin-https-nginx-setting-up/5127/15 "2022-02-02T14:53:12Z")

</div>

Thanks will check this out and let you know.

---

<div class="post-metadata">

### Author: ![alleyu2](https://dietpi.com/forum/user_avatar/dietpi.com/alleyu2/32/2097_2.png) [@alleyu2](https://dietpi.com/forum/u/alleyu2)
#### Post date: [3 February 2022 08:25 UTC](https://dietpi.com/forum/t/jellyfin-https-nginx-setting-up/5127/16 "2022-02-03T08:25:41Z")

</div>

> [@](#):
>
> ah right we had the same issue but did not find a solution. Unfortunately lighttpd is not the best choice to run a revers proxy.
> 
> I guess something like the socket would need to be forward as well, looking to the other proxy configuration  
>   
>   
> EDIT: I played with it and at least I got it working for myself if I set a base URL /jellyfin inside Jellyfin configuration panel. That’s within the network section.
> 
> lighttpd config file is like this.
> 
> ```plaintext
> root@DietPiVM-H:~# cat /etc/lighttpd/conf-available/99-jellyfin.conf
> $HTTP["url"] =~ "^/jellyfin" {
> proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => 8096 ) ) )
> }root@DietPiVM-H:~#
> 
> ```

Yes, this worked. Thanks a lot. Downside is that it is putting too much load on my raspberry pi 4 and hence creating lag in watching videos. The proxy is on raspberry pi and the host is a windows desktop machine (i5 with graphics card). Not sure if this is a viable solution. Without proxy the video performance is great. Thanks once again!

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [3 February 2022 13:41 UTC](https://dietpi.com/forum/t/jellyfin-https-nginx-setting-up/5127/17 "2022-02-03T13:41:27Z")

</div>

try to watch htop to see what is causing the load

---

<div class="post-metadata">

### Author: ![alleyu2](https://dietpi.com/forum/user_avatar/dietpi.com/alleyu2/32/2097_2.png) [@alleyu2](https://dietpi.com/forum/u/alleyu2)
#### Post date: [3 February 2022 14:56 UTC](https://dietpi.com/forum/t/jellyfin-https-nginx-setting-up/5127/18 "2022-02-03T14:56:50Z")

</div>

it is due to the Lighttpd process.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [3 February 2022 19:54 UTC](https://dietpi.com/forum/t/jellyfin-https-nginx-setting-up/5127/19 "2022-02-03T19:54:20Z")

</div>

indeed, seems the proxy is not really able to deal with the lead. Not sure if there is a way to rune this or how other proxy web server, like nginx, might behave.

---

<div class="post-metadata">

### Author: ![alleyu2](https://dietpi.com/forum/user_avatar/dietpi.com/alleyu2/32/2097_2.png) [@alleyu2](https://dietpi.com/forum/u/alleyu2)
#### Post date: [4 February 2022 08:16 UTC](https://dietpi.com/forum/t/jellyfin-https-nginx-setting-up/5127/20 "2022-02-04T08:16:04Z")

</div>

I can try nginx and post my feedback here but I would need help with the config file for that. Is it possible for you to post an example of the config file ?

The default nginx jellyfin config file didn’t work for me.

[https://jellyfin.org/docs/general/networking/nginx.html](https://jellyfin.org/docs/general/networking/nginx.html)

[Next page](https://dietpi.com/forum/t/jellyfin-https-nginx-setting-up/5127.md?page=2)
