Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse proxy with SSL not working with Hyperion.ng #923

Closed
m33ts4k0z opened this issue Aug 1, 2020 · 6 comments · Fixed by #924
Closed

Reverse proxy with SSL not working with Hyperion.ng #923

m33ts4k0z opened this issue Aug 1, 2020 · 6 comments · Fixed by #924

Comments

@m33ts4k0z
Copy link
Contributor

Hello,

I saw a similar issue some months ago that it was immediately closed as a non-hyperion issue. Actually it is a hyperion issue and is really easy to fix. The problem lies in the hyperion.js file:

window.jsonPort = (document.location.port == '') ? '80' : document.location.port; window.websocket = (document.location.protocol == "https:") ? new WebSocket('wss://'+document.location.hostname+":"+window.jsonPort) : new WebSocket('ws://'+document.location.hostname+":"+window.jsonPort);

When a proxy_pass is performed through a reverse proxy, the address bar doesnt have a port. that makes Hyperion WebSocket default to 80. So HTTP works. On the other hand, when SSL is used, Hyperion is again using port 80 since again the reverse proxy doesn't show a port on the address bar but that results in a protocol missmatch error. Since this file is baked into the binary, it is not easy to edit. However it would suffice if port 443 is used when https is detected.

@Lord-Grey
Copy link
Collaborator

@m33ts4k0z not sure what is the problem with binary...?
Update the following file and do a Pull-Request:

https://github.com/hyperion-project/hyperion.ng/blob/c124e2136a47bfd488afdff54a2bf0d41da18e74/assets/webconfig/js/hyperion.js

@m33ts4k0z
Copy link
Contributor Author

m33ts4k0z commented Aug 1, 2020

@Lord-Grey Sorry how can I update the file? I don't have access to do that. Do you mean download it locally, edit and compile? Sorry, I'm not that familiar with GitHUB but I think i got what you mean :) I will recompile with my fixes and once I'm happy with the result, I will make a pull request.

@tpmodding
Copy link
Collaborator

Fork this repo to your account, make the changes, then you can submit a Pull request from your changed repo to our repo :-)

@m33ts4k0z
Copy link
Contributor Author

I have now implemented and tested a fix that should cover all cases.

@m33ts4k0z
Copy link
Contributor Author

After the fix is applied, you can use this configuration for Nginx reverse proxy. It includes auto SSL redirection and support for certbot certificate auto renewal if you use Let's Encrypt.

@tpmodding
Copy link
Collaborator

unraid ftw 👍

@Lord-Grey Lord-Grey linked a pull request Aug 1, 2020 that will close this issue
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants