Closed ykxiao closed 1 year ago
Your software version (Screenshot of your startup)
Detail description about this issue(error/log)
代理后只能获取到容器IP,获取不到真实IP
Some reproducible code blocks and steps
reproducible
steps
$clientIp = $request->header('X-Forwarded-For') ?? $request->header('X-Real-IP') ?? $request->ip();
这个要求Nginx要配置正确, 例如,你配置Nginx:proxy_set_header X-Real-IP $remote_addr; 就可以通过$request->header('X-Real-IP') 获取Nginx外层访问用户的IP
好的,谢谢,问题已解决。当时配置了一直在本地跑,测试环境就好了。
Your software version (Screenshot of your startup)
Detail description about this issue(error/log)
代理后只能获取到容器IP,获取不到真实IP
Some
reproducible
code blocks andsteps