NGNIX 返回 502

问题描述

我在 RHEL 8.2 服务器上运行以配置 Nginx 反向代理服务器的自定义脚本:

#!/bin/sh
sudo yum install Nginx -y
sudo systemctl enable --Now Nginx
sudo firewall-cmd --add-service=https --permanent
sudo firewall-cmd --add-service=http --permanent
sudo systemctl restart firewalld
sudo cat > /etc/Nginx/Nginx.conf <<EOF
worker_processes  1; 

events {
    worker_connections  1024;
}

http {  
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;

    server {
        listen       80 default_server;
        server_name  _;
        
        location / {
            proxy_pass http://y:80;
        }
        #location /api {
        #   proxy_pass http://x/api;
        #} # end location
    } # end server
} # end http
EOF

sudo systemctl restart Nginx

有人看到配置错误吗?脚本本身在 Azure VMSS 实例上运行,80 端口监听良好(实例健康)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)