mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-02-05 00:29:40 +03:00
"New Device Logged In" shows wrong IP #355
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tycho on GitHub (Aug 1, 2019).
The "New Device Logged In" email gave me this:
My nginx config is setting the
X-Real-IPandX-Forwarded-Forheaders for the reverse proxy. Am I missing some other one that would make it recognize what the real client IP is? Or is bitwarden_rs just ignoring those headers for some reason?@janost commented on GitHub (Aug 1, 2019):
Are you sure you are properly setting
X-Real-IP?I was able to reproduce the issue without that header, however adding it back fixed the issue.
@tycho commented on GitHub (Aug 1, 2019):
I just figured it out. nginx seems to violate the "principle of least astonishment" for me rather frequently.
Here's basically what I had (removed the unimportant stuff to focus on the issue itself):
The problem was that apparently the
proxy_set_headers in theserver{}scope don't propagate to childlocation ... {}scopes. When I do this, it works as intended:I feel like I should just write a tool that generates my nginx configs at this point. They are uncomfortably verbose and I end up doing a lot of duplication to get things to behave.