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

Tornado reverse proxy issue #1477

Closed
douglasak opened this issue Jun 8, 2020 · 7 comments
Closed

Tornado reverse proxy issue #1477

douglasak opened this issue Jun 8, 2020 · 7 comments
Labels

Comments

@douglasak
Copy link

douglasak commented Jun 8, 2020

Describe the bug/problem
I'm having an issue with version 0.6.8 in the LinuxServer docker. Version 0.6.7 works fine. The issue occurs when accessing Calibre-Web through an SSL reverse proxy. The error message shows up in the log below and Nginx reports "502 Bad Gateway".

Calibre-Web works fine when accessing directly outside the reverse proxy.

To Reproduce
Access webpage through SSL reverse proxy.

Logfile
Add content of calibre-web.log file or the relevant error, try to reproduce your problem with "debug" log-level to get more output.

[2020-06-08 14:26:07,040] ERROR {tornado.application:67} Uncaught exception
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/tornado/http1connection.py", line 273, in _read_message
delegate.finish()
File "/usr/local/lib/python3.6/dist-packages/tornado/httpserver.py", line 280, in finish
self.request_callback(self.request)
File "/usr/local/lib/python3.6/dist-packages/tornado/wsgi.py", line 114, in call
WSGIContainer.environ(request), start_response
File "/usr/local/lib/python3.6/dist-packages/tornado/wsgi.py", line 154, in environ
port = int(hostport[1])
ValueError: invalid literal for int() with base 10: '443,calibre.internaldomain.net

Expected behavior
Calibre-Web should load correctly through the reverse proxy.

Screenshots
N/A

Environment (please complete the following information):

  • OS: Docker
  • Python version: Python 3.6
  • Calibre-Web version: 0.6.8 not 0.6.7
  • Docker container: LinuxServer 0.6.8-ls66 and 0.6.8ls65 but not 0.6.7-ls64

Additional context
Access via reverse proxy

@mediacrave
Copy link

I experience the same issue with the same Environment above.

Back on 0.6.7 for now

@OzzieIsaacs
Copy link
Collaborator

Looks to me not like a problem with calibre-web itself.
Seems to be a missconfiguration in the environment variables (CALIBRE_PORT), instead of 443 the configuration value looks like 443,calibre.internaldomain.net.
Please report the issue at the LinuxServer docker repro

@mediacrave
Copy link

mediacrave commented Jun 8, 2020

I know nothing, but when I'm on the 0.6.7 docker image by linuxserver and upgrade within the docker it also breaks even without updating to the latest 0.6.8 docker image.
I have tried setting CALIBRE_PORT variable within the docker template with no luck.

Again, I know very little...

@tobbenb
Copy link

tobbenb commented Jun 8, 2020

@OzzieIsaacs You can close this issue. The issue is in our letsencrypt container and is fixed by updating the proxy.conf in the /config/nginx/ folder.

@OzzieIsaacs
Copy link
Collaborator

Thanks for fixing it

@douglasak
Copy link
Author

Thank you both.

@tobbenb
Copy link

tobbenb commented Jun 8, 2020

It was already fixed in October last year :)
The issue was the line below in the reverse proxy config for calibre-web in combination with using an old version of the proxy.conf and version 0.6.8 of Calibre-web.

proxy_set_header Host $http_host;

The only change in the proxy.conf was from
proxy_set_header Host $host:$server_port;

to
proxy_set_header Host $host;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants