docker下nginx配置 proxy_set_header要报错
来源:1-8 配置 Nginx 端口代理与域名指向
icerainsnow
2018-04-02
#upstream blog {
#server node:3000;
#}
server {
listen 80;
server_name 101.132.183.100;
location / {
proxy_pass http://node:3000;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Nginx-Proxy true;
proxy_redirect off;
}
}
错误信息:
2018/04/02 08:33:55 [emerg] 1#1: invalid number of arguments in "proxy_set_header" directive in /etc/nginx/conf.d/default.conf:9
nginx: [emerg] invalid number of arguments in "proxy_set_header" directive in /etc/nginx/conf.d/default.conf:9
1回答
-
Scott
2018-04-03
试着把
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Nginx-Proxy true;
proxy_redirect off;
都删掉,然后应该是正常的,再逐行加上面的代码,每加一行试一下,看能不能倒查出是哪一行的问题导致的
00
相似问题