jellyfin-archive / jellyfin-docs

Documentation for Jellyfin
https://jellyfin.org
Creative Commons Attribution Share Alike 4.0 International
143 stars 222 forks source link

Cannot setup a reverse proxy using the documentation #48

Open pyluyten opened 5 years ago

pyluyten commented 5 years ago

I used this documentation : https://jellyfin.readthedocs.io/en/latest/administrator-docs/reverse-proxy/ .

Some items were not clear to me.

Anyway so i figured i can add a VirualHost on my machine running jellyfin, pointed a DNS subdomain to this machine IP, added the code snippet, activated the site.

If I go to jellyfin.my-site.xxx, i will obtain : "INTERNAL SERVER ERROR'. Server log says, "[Tue Mar 05 23:28:28.924719 2019] [proxy:warn] [pid 24036] [client xx.xxx.xx.xxx:56940] AH01144: No protocol handler was valid for the URL /embywebsocket. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule."

At the moment i did not figured issue yet, but almost certain the doc does not explain what to do. (Missing prerequisite?)

However rather than my little issue the reason i open this ticket is to discuss the documentation.

JustAMan commented 5 years ago

cc @mcarlton00 @joshuaboniface

mcarlton00 commented 5 years ago

Admittedly, Apache is the one that I'm the least familiar with. I copied the config that @sauerj provided and tested it locally to make sure it works. It sounds like you possibly didn't enable the extra modules from the section that's under the main code block for Apache. Try running a2enmod proxy proxy_http ssl and then restart Apache. Sometimes these are included by default, sometimes they need to be a manual step. I think it depends on which distro you're using.

As for improvements:

  • running http server + own domain name

The docs are outlining how to set up a http server, so I'm not sure that should necessarily be a requirement. I hesitate to include installation instructions just because of how much variance there is between distros and package managers. We probably should make a note about the domain name, though. It's really only strictly necessary if people are accessing the server from outside their local network, but it's almost certainly the most common use case we'll see.

  • machine running jellyfin is also the machine running the reverse proxy
  • highlight which part of code snippet should be adapted

I think these are actually a single point, but two different variables. I work with these things every day so it's obvious to me what needs to be changed, but looking at it now I agree that it could be clearer for the average user. Possibly replace the values in the code blocks with something like $SERVER_IP_ADDRESS and $DOMAIN_NAME so they stand out, and make a note of it in the beginning explanation.

The same could possibly be said for the SSL cert. I'm going off the assumption that the large majority of users will be using LetsEncrypt, but it could potentially be changed to /path/to/your/ssl/certificate instead of assuming.

I'll let @joshuaboniface weigh in as well. I won't have time to update anything until at least this weekend, possibly longer.

pyluyten commented 5 years ago

The docs are outlining how to set up a http server, so I'm not sure that should necessarily be a requirement. [...] We probably should make a note about the domain name, though.

Fair to me. Maybe include a note, this needs both setup on the DNS provider + on the http server.

Possibly replace the values in the code blocks with something like $SERVER_IP_ADDRESS and $DOMAIN_NAME so they stand out, and make a note of it in the beginning explanation.

It would have helped me because i knew I needed to change thoses but i did not know if i needed to change others parts.

The same could possibly be said for the SSL cert

yes also i bet some people have cert including domain + subdomains.

Try running a2enmod proxy proxy_http ssl and then restart Apache


# a2enmod proxy proxy_http
Module proxy already enabled
Considering dependency proxy for proxy_http:
Module proxy already enabled
Module proxy_http already enabled

Also tried proxy_html.

pyluyten commented 5 years ago

by the way for some reason, my setup does now work. Only thing i did in the meantime was to test from local machine 127.0.0.1:8096 . Did this test actually performed something?

JustAMan commented 5 years ago

Maybe you restarted Apache in the meantime, and it fixed something it didn't read in your configuration for the first time?

pyluyten commented 5 years ago

@JustAMan just checked, after last restart (basically each time i tried to load a proxy_xxx module) i was still trying to acess, with no luck. And the site config has not changed neither. Anyway i propose to keep the bug opened regarding the documentation which may be improved.

pyluyten commented 5 years ago

The reason it did not work is just Firefox 65.0.2 (64-bit). Firefox on Android works, Chrome works, but not this version.. Which is why i could not figure what i changed server side, indeed nothing.

mcarlton00 commented 5 years ago

I have Firefox 65.0.2 on linux, and I was able to load up the Web UI and start a stream through an Apache proxy while testing. Could it be a bad cookie or something in your browser that isn't letting the page load? Can you try it in private browsing mode?

pyluyten commented 5 years ago

@mcarlton00 , sorry i missed this! Some clearing in firefox persistent data and it works now (even in normal mode).

before it worked i also wondered : "now i wrote the apache snippet, what am i supposed to do?" It is fair to assume user knows to "a2ensite" , but it may be worth explaining then it is just necessary to visit the jellyfin.DOMAIN_NAME with browser. Otherwise if it does not work, user may believe other prerequisites / steps are missing. (eg among others i tried to navigate to https://jellyfin.DOMAIN_NAME/embywebsocket )

miket6000 commented 4 years ago

Just adding that as well as the listed proxy_http module, I also needed to enable the proxy_wstunnel module before this worked for me. I don't see any harm in mentioning this along with the other require modules. This may have been related to other users issues with the /embysocket forwarding issue.

JustAMan commented 4 years ago

@miket6000 can you make a PR to Apache section about adding that module?

stophecom commented 2 years ago

More of a side note, but it might be helpful to include a hint to services like https://ngrok.com/ in the docs.