-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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
Trust Proxy settings not being respected #3118
Comments
Hi @sanchitgera your stack trace shows |
I'm on a slightly older version. |
Thanks, @sanchitgera I tried with 4.13.4 using your information above, but had no issue logging with Morgan through NGINX. I had to guess a lot about what is happening. Is there any additional information you can provide to help me reproduce the issue? |
I'm afraid I can't share too much from the codebase. :( But the error isn't very consistent. I don't get the error on every request. But from what I can tell, there is nothing inherently different about the requests that do lead to the error. I have a custom authentication scheme in place relying on specific |
Ah, I see @sanchitgera . I'm afraid I'm not sure how I should proceed here, unless you have any suggestions? |
That's alright! Thanks for all your help! I really appreciate it. |
Yea, I would love to figure it out, if you can even post a simplified app that I can use to reproduce the issue. As for morgan, you can always overwrite the |
I have set up an Express app with Morgan for logging behind an NGINX proxy. I have configured the
trust proxy
setting in my root file like so:But when I actually run the app and start making requests, I see the following error trace:
It appears that Morgan attempts to get the ip address of the incoming request using the getter defined by Express, but fails because the trust argument is set to false. Any thoughts?
I have also tried wrapping the second argument in `app.set('trust proxy' in a function but that doesn't make a difference. Thanks!
The text was updated successfully, but these errors were encountered: