-
Notifications
You must be signed in to change notification settings - Fork 88
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
Space between IP Addresses in $http_x_forwarded_for #36
Comments
jasonrogena
added a commit
to jasonrogena/gonx
that referenced
this issue
Jan 18, 2018
Since there's the possibility for the http_x_forwarded_for Nginx variable to contain a space (right after the comma separating two IP addresses), create a regex for handling this variable. Change the way the Nginx format regex is created by adding logic for including special regexes. Fixes satyrius#36 Signed-off-by: Jason Rogena <[email protected]>
jasonrogena
added a commit
to jasonrogena/gonx
that referenced
this issue
Jan 18, 2018
Since there's the possibility for the http_x_forwarded_for Nginx variable to contain a space (right after the comma separating two IP addresses), create a regex for handling this variable. Change the way the Nginx format regex is created by adding logic for including special regexes. Fixes satyrius#36 Signed-off-by: Jason Rogena <[email protected]>
当 http_x_forwarded_for 有多个ip时,没有办法解析日志,我使用 conradolega https://github.com/conradolega/gonx/tree/fix-http-forwarded-for 解决了这个问题 When http_x_forwarded_for has multiple ips, there is no way to parse the logs, I solved the problem using conradolega https://github.com/conradolega/gonx/tree/fix-http-forwarded-for |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nginx's
$http_x_forwarded_for
can contain multiple IP addresses (in cases where a reverse proxy is used). In such cases the format used is[IP Address]([Comma][Space][IP Address])+
. I guess since this value is gotten from the X-Forwarded-For header.Gonx is able to parse
[IP Address]([Comma][Space][IP Address])+
but not[IP Address]([Comma][IP Address])+
.The text was updated successfully, but these errors were encountered: