“502 bad gateway error nginx” - Web 应用程序在 http://itrendsolution.org:5000 中工作,但无法将“itrendsolution.org”重定向到此地址

问题描述 投票:0回答:1

我的网络应用程序运行于 http://191.101.1.48:5000 我的域 itrendsolution.org 的 IP 地址为 191.101.1.48 [正确指向] 但当我访问 itrendsolution.org 时,它显示“502 Bad gateway error nginx”。 我使用cloudpanel(VPS托管)来托管Flask Web应用程序,它与MySql连接。

我使用了 Nginx ,因此当人们访问 https://itrendsolution.org 时,他们会通过“代理通行证”重定向到在 http [http://191.101.1.48:5000] 的端口 5000 中运行的 Web 应用程序nginx 配置。

我有 ssl 证书。当我访问 itrendsolution.org 时,它仍然不起作用。如何使在 http://191.101.1.48:5000 中运行的 Web 应用程序在 https://191.101.1.48 或 itrendsolution.org 中运行?

我尝试了 nginx 配置来重定向。

nginx https nginx-reverse-proxy vps bad-gateway
1个回答
0
投票

您应该在 proxy_pass 中指定协议,例如

proxy_pass http://191.101.1.48:5000;
如果 nginx 和您的应用程序运行在同一主机上,您可以尝试使用
proxy_pass http://127.0.0.1:5000;

© www.soinside.com 2019 - 2024. All rights reserved.