location ~ /\. {
##在每个location种添加以下代码 proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 客户端真实协议(http/https) proxy_set_header X-Forwarded-Proto $scheme; }