Nginx proxy_set_header

proxy_set_header:即允许重新定义或添加字段传递给代理服务器的请求头。该值可以包含文本、变量和它们的组合。

语法:    proxy_set_header field value;
默认值:    
proxy_set_header Host $proxy_host;
proxy_set_header Connection close;
上下文:    http, server, location

NGINX甚至提供了 $proxy_add_x_forwarded_for 变量来自动将 $remote_addr 附加到任何传入的 X-Forwarded-For 标头中

参考:

http://www.51niux.com/?id=135

https://www.nginx.com/resources/wiki/start/topics/examples/forwarded/

https://www.cnblogs.com/kevingrace/p/8269955.html

猜你喜欢

转载自www.cnblogs.com/stellar/p/12124384.html