Skip to content

Fixing jdownloader websockets #774

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

Merged
merged 4 commits into from
Aug 7, 2025
Merged

Conversation

therobbiedavis
Copy link
Contributor

linuxserver.io


  • I have read the contributing guideline and understand that I have made the correct modifications

Description

Websockets were failing when trying to connect via reverse proxy

Benefits of this PR and context

Fixes websocket failing to connect.

How Has This Been Tested?

Once change was applied websockets were able to connect.

Source / References

jlesage/docker-jdownloader-2#265 (comment)

Copy link
Member

@drizuid drizuid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@github-project-automation github-project-automation bot moved this from PRs to PRs Approved in Issue & PR Tracker Aug 7, 2025
@aptalca
Copy link
Member

aptalca commented Aug 7, 2025

Thanks but have you tested this?

I do realize what we had before was incorrect, but the proposed fix also looks incorrect.

The reason is, when you use a variable in the proxy_pass line, nginx has this weird behavior where it automatically appends the location to the end of the proxy_pass address. Really weird behavior that is not really documented anywhere that I could find. It doesn't do that when you use an actual address like an ip or a dns hostname.

@therobbiedavis
Copy link
Contributor Author

@aptalca Yes, currently using it and it works for me.

@drizuid
Copy link
Member

drizuid commented Aug 7, 2025

Thanks but have you tested this?

I do realize what we had before was incorrect, but the proposed fix also looks incorrect.

The reason is, when you use a variable in the proxy_pass line, nginx has this weird behavior where it automatically appends the location to the end of the proxy_pass address. Really weird behavior that is not really documented anywhere that I could find. It doesn't do that when you use an actual address like an ip or a dns hostname.

i did not test (i dont use jdownloader), but i did look through jdownloaders forums and saw similar suggestions for npm and pure nginx. I will add, i saw a websocket path for audio as well, which we lack. i didnt mention it because im not sure our container even supports the audio portion, again, never used this :D

@aptalca
Copy link
Member

aptalca commented Aug 7, 2025

Right, unfortunately most of those guides use an IP or a dns hostname so they don't hit that weird behavior. We use vars to make sure nginx doesn't complain and refuse to start when a proxied service is not up or reachable. Another weird nginx behavior.

That's why when we have a separate server block for api endpoints that bypass auth, we don't add /api to the proxy_pass line: https://github.com/linuxserver/reverse-proxy-confs/blob/master/bazarr.subdomain.conf.sample#L61

But if it works, I'm ok with merging it. @therobbiedavis can you update the date on the first line as well so it shows up in SWAG log as a conf that needs an update?

Thanks

@therobbiedavis
Copy link
Contributor Author

Right, unfortunately most of those guides use an IP or a dns hostname so they don't hit that weird behavior. We use vars to make sure nginx doesn't complain and refuse to start when a proxied service is not up or reachable. Another weird nginx behavior.

That's why when we have a separate server block for api endpoints that bypass auth, we don't add /api to the proxy_pass line: https://github.com/linuxserver/reverse-proxy-confs/blob/master/bazarr.subdomain.conf.sample#L61

But if it works, I'm ok with merging it. @therobbiedavis can you update the date on the first line as well so it shows up in SWAG log as a conf that needs an update?

Thanks

@aptalca Done.

@aptalca aptalca merged commit e972b1a into linuxserver:master Aug 7, 2025
2 checks passed
@LinuxServer-CI LinuxServer-CI moved this from PRs Approved to Done in Issue & PR Tracker Aug 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants