Jellyfin Forum
Trying to reverse proxy, setting baseurl results in web error - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+---- Forum: Networking & Access (https://forum.jellyfin.org/f-networking-access)
+---- Thread: Trying to reverse proxy, setting baseurl results in web error (/t-trying-to-reverse-proxy-setting-baseurl-results-in-web-error)



Trying to reverse proxy, setting baseurl results in web error - BenJeremy - 2024-03-23

AS the title says, I just set up Jellyfin on my Ubuntu server. I have Apache2 with a Lets Encrypt cert exposed (no-ip.org dynamic name). I havchrome gicves me: ""e a lot of web apps working great through the reverse proxy, and yes, I followed the directions on the Jellyfin docs.
When I set the baseurl in network settings, the page refreshes, and even gets the redirect with the /jellyfin prefix, but chrome gives me: "No webpage was found for the web addresseb", whether I'm local or external. It actually does a redirect on the URL path, too.

Editing the network.xml file and restarting it "fixes" it locally. 

I'd really like to get this working as https://mydomain.no-ip.org/jellyfin (same as my 5 other apps, which work fine)

This seems like a specific Jellyfin issue.

Any ideas?


RE: Trying to reverse proxy, setting baseurl results in web error - TheDreadPirate - 2024-03-24

You also updated your Apache config?

Can you share your Apache config with us? Censor the domains.


RE: Trying to reverse proxy, setting baseurl results in web error - BenJeremy - 2024-03-24

(2024-03-24, 12:12 AM)TheDreadPirate Wrote: You also updated your Apache config?

Can you share your Apache config with us?  Censor the domains.

Code:
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf


ServerName xxxxxxxx.no-ip.org
SSLCertificateFile /etc/letsencrypt/live/xxxxxxxx.no-ip.org/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/xxxxxxxx.no-ip.org/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
<Location /sabnzbd>
    order deny,allow
    deny from all
    allow from all
    ProxyPass http://localhost:8060/sabnzbd
    ProxyPassReverse http://localhost:8060/sabnzbd
</Location>

<Location /sonarr>
    ProxyPreserveHost on
    ProxyPass http://127.0.0.1:8989/sonarr connectiontimeout=5 timeout=300
    ProxyPassReverse http://127.0.0.1:8989/sonarr
</Location>

<Location /lidarr>
    ProxyPreserveHost on
    ProxyPass http://127.0.0.1:8686/lidarr connectiontimeout=5 timeout=300
    ProxyPassReverse http://127.0.0.1:8686/lidarr
</Location>

<Location /readarr>
    ProxyPreserveHost on
    ProxyPass http://127.0.0.1:8787/readarr connectiontimeout=5 timeout=300
    ProxyPassReverse http://127.0.0.1:8787/readarr
</Location>

<Location /radarr>
    ProxyPreserveHost on
    ProxyPass http://127.0.0.1:7878/radarr connectiontimeout=5 timeout=300
    ProxyPassReverse http://127.0.0.1:7878/radarr
</Location>

<Location /jellyfin/socket>
    ProxyPreserveHost On
    ProxyPass "ws://127.0.0.1:8096/jellyfin/socket"
    ProxyPassReverse "ws://127.0.0.1:8096/jellyfin/socket"
</Location>
<Location /jellyfin>
    ProxyPass "http://127.0.0.1:8096/jellyfin"
    ProxyPassReverse "http://127.0.0.1:8096/jellyfin"
</Location>


This is exactly out of the Jellyfin docs.

As I said, it also fails to work locally after changing the base url to /jellyfin
The settings page, after saving the change, cycles then displays redirects to the same location, with the new baseurl prefixed... and the chrome error.

The home page goes from:

Code:
http://mediaserver.local:8096/web/index.html#!/home.html
  (Working)

to:

Code:
http://mediaserver.local:8096/jellyfin/web/index.html#!/home.html
  (Not Working)

So it's not a problem with the Apache configuration, I think. If the local is failing to display a web page, the reverse proxy will simply echo that.


RE: Trying to reverse proxy, setting baseurl results in web error - TheDreadPirate - 2024-03-24

Adding a trailing slash after Jellyfin in this section

Code:
<Location /jellyfin/>

    ProxyPass "http://127.0.0.1:8096/jellyfin/"

    ProxyPassReverse "http://127.0.0.1:8096/jellyfin/"

</Location>

This worked for another user. They were running Nginx, but the concept may still apply.

https://forum.jellyfin.org/t-solved-solved-blank-white-page?pid=13202#pid13202

If this works for you, I will research it and update our docs appropriately.


RE: Trying to reverse proxy, setting baseurl results in web error - BenJeremy - 2024-03-24

(2024-03-24, 01:24 AM)TheDreadPirate Wrote: Adding a trailing slash after Jellyfin in this section

Code:
<Location /jellyfin/>

    ProxyPass "http://127.0.0.1:8096/jellyfin/"

    ProxyPassReverse "http://127.0.0.1:8096/jellyfin/"

</Location>

This worked for another user.  They were running Nginx, but the concept may still apply.

https://forum.jellyfin.org/t-solved-solved-blank-white-page?pid=13202#pid13202

If this works for you, I will research it and update our docs appropriately.


This did not work.

As noted before, it does the redirect...

https://xxxxxxxxx.no-ip.org/jellyfin/web/index.html
when going to https://xxxxx.no-ip.org/jellyfin 

but "No webpage was found" for thee index.html

Same goes for local, as well. I get the redirect inserting the baseurl, but same chrome error.

I do not think this is an Apache issue.