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

BUG: 400 wrong host name error with Nginx revrse proxy #183

Closed
corch opened this issue Nov 19, 2020 · 5 comments
Closed

BUG: 400 wrong host name error with Nginx revrse proxy #183

corch opened this issue Nov 19, 2020 · 5 comments

Comments

@corch
Copy link

corch commented Nov 19, 2020

I have etesync running in gunicorn listening on port 8811, behind an nginx proxy which is listening on port 8810.
My Nginx config is copied from https://github.com/etesync/server/wiki/Production-setup-using-Daphne-and-Nginx.
When I try to sign in using etesync-web on my local machine using the python3 http.server, I get the following error:

"400 Found wrong host name. Got: "example.foo:8810" expected: "example.foo"

This type of error is normally associated with an incorrectly set or missing "proxy_set_header Host $host;" line in the nginx config, but this line is present in the config copied from the github example. I have tried messing around with this setting a bit, changing the value to a static string "example.foo", it doens't seem to change the behaviour one way or another.

The nginx access log shows the following when trying to log in:

x.x.x.x - - [20/Nov/2020:10:32:48 +1100] "OPTIONS /api/v1/authentication/login/ HTTP/1.1" 200 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0"
x.x.x.x - - [20/Nov/2020:10:32:48 +1100] "POST /api/v1/authentication/login/ HTTP/1.1" 400 124 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0"

I don't think there's a problems in general with my etesync server, my phone can sync the calendar fine (address book I'm having issues with, that's what I wanted the web client to check).

I'm not sure what else to check or try. My best guess at this point is that the web client doesn't support using a non standard port for the web server for some reason? Or does not support using a reverse proxy at all?

@tasn
Copy link
Member

tasn commented Nov 20, 2020

I think it was fixed in 843b59a0ac1e2076a514b9c52fc5c6941b27dff0 (so part of v0.5.2). Are you using the latest version?

@corch
Copy link
Author

corch commented Nov 20, 2020

I'm not 100% sure what version I have, I downloaded from https://pim.etesync.com/etesync-web.tgz on 11 November, the bug is still present there. I assume this is probably still 0.5.1 as that is what is showing as the most current release on the Github page. Where can I get 0.5.2?

@tasn
Copy link
Member

tasn commented Nov 21, 2020

Sorry, I was talking about the server, not the client. You are using a custom server, right? You need to make sure it's up to date.

@corch
Copy link
Author

corch commented Nov 25, 2020

Right, sorry. Yes its a custom server. Upgraded server and problem solved, thanks.

@tasn
Copy link
Member

tasn commented Nov 25, 2020

Great! :)

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

No branches or pull requests

2 participants