【发布时间】:2018-09-24 22:43:43
【问题描述】:
我正在使用 nginx、django 和 gunicorn,并且在启用了 nginx 站点的配置中的 proxy_pass 行上不断收到错误无效的参数数量。根据 nginx 文档,我相信这是正确的方法。我哪里错了?我真的被困住了。
upstream app_server{
server xxx.xxx.xx.xxx:8000 fail_timeout=0;
}
location @proxy_to_app {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host
proxy_redirect off;
proxy_pass http://app_server;
}
我检查了以下解决方案@[类似问题][1],但它没有回答为什么上面的配置不起作用[1]:nginx invalid number of arguments in "proxy_pass" directive。 我什至尝试使用 proxy_pass http://xxx.xxx.xx.xxx:8000;还是一样的错误。
【问题讨论】:
标签: nginx