我试图在我的Nginx.conf文件中添加proxy_set_header。 当我尝试添加proxy_pass并调用URL时,会抛出502 Bad Gateway Nginx / 1.11.1错误。
upstream app-server { # connect to this socket server unix:///tmp/alpasso-wsgi.sock; # for a file socket } server { server_name <name>; listen 80 default_server; # Redirect http to https rewrite ^(.*) https://$host$1 permanent; } server { server_name <name>; listen 443 ssl default_server; recursive_error_pages on; location /azure{ proxy_pass http://app-server; } ssl on; ssl_certificate /etc/Nginx/server.crt; ssl_certificate_key /etc/Nginx/server.key; ssl_client_certificate /etc/Nginx/server.crt; ssl_verify_client optional; }
Nginx,fastcgi PHP Windows,没有指定input文件
部署本地Nginx服务器到公共ubuntu 16.04
Node.js应用程序的Nginx代理configuration问题
Rails – Elastick Beanstalk Nginx / error.log
Nginx API版本控制技术
Nginx – 在离开安全页面时将HTTPSredirect回HTTP
我如何列出Nginx中的所有虚拟主机
在uwsgi上切换python版本
DKIM:签名标题存在但无效
与proxy_pass有类似的问题,如果你的Linux服务器使用SELINUX,那么你可能想试试这个。
setsebool -P httpd_can_network_connect true
参考沃伦的答案: https : //unix.stackexchange.com/questions/196907/proxy-Nginx-shows-a-bad-gateway-error
尝试:
location /azure { proxy_pass appserver; }
当你的上游不可达时, 502发送。
尝试打开error log ,您可能会看到Failed to connect to upstream ,因此您需要检查您的upstream服务器是否正在运行, sudo service upstream status ,并尝试打开。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。