Nginx proxy 代理网站常用优化配置
vim /etc/nginx/proxy_params
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 30;
proxy_send_timeout 60;
proxy_read_timeout 60;
proxy_buffering on;
proxy_buffer_size 32k;
proxy_buffers 4 128k;
#//如何调用
#location / {
# proxy_pass http://10.0.0.10:80;
# include proxy_params;
#}
有一些proxy_params 文件名称是别的,具体要查看nginx.conf文件的proxy位置
设置完这些需要重启一下nginx,(出现过reload 不生效的情况)