-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5528f64
commit 427cc72
Showing
2 changed files
with
23 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
427cc72
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
config.py 里的是 reverse_proxy allow_proxy 与 main.py 中的
if (config.read_config('common.reverse_proxy.enable')):
不匹配427cc72
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好了好了,修了
427cc72
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aiologger.info(f'{request.remote_addr + "" if (request.remote == request.remote_addr) else f"|proxy@{request.remote}"} - {request.method} "{request.path}", {resp.status}')
在使用反代的环境下,并设置对了header的情况下(在我的环境下是X-Forwarded-For),request.remote_addr能获得真实ip地址,但是log中显示的是proxy@127.0.0.1,看了下ban ip也是用的request.remote_addr所以使用上应该不会有任何问题。只是log显示proxy@127.0.0.1除了告诉自己用了反代没有任何意义,应该很少有情况需要在log中区分这些请求是否通过了反代,个人感觉直接显示真实ip就够了