在使用 Nginx 进行配置时,有时会遇到服务端获取客户端 IP 一直为 127.0.0.1 的问题。这可能是由于配置不正确导致的。本篇博客将介绍一些解决该问题的方法。
nginx 重定向常用两个配置 rewrite 与 return 。
nginx 重定向
rewrite
return