首页 > 解决方案 > CentOS 7 上的 Nginx 安装成功,也获得了默认页面,但是当尝试浏览应用程序时,它给出了 nginx 错误

问题描述

CentOS 7 上的 Nginx 也成功安装并获得了默认页面,但是当尝试浏览应用程序时,它会给出

nginx error 你要找的页面暂时不可用。请稍后再试。

当检查 error.log 它说

2020/10/30 10:25:01 [crit] 355290#0: *1 connect() 到 127.0.0.1:7823 连接到上游时失败(13:权限被拒绝),c$

添加 nginx.conf 详细信息:

服务器 {

    listen 443 ssl;
    listen [::]:443 ssl;
    server_name xxxxx.in;
    ssl_certificate     /etc/nginx/ssl/xxx.crt;
    ssl_certificate_key /etc/nginx/ssl/xxx.key;

    root /usr/share/nginx/html;
    #root         /var/www/html;

    #index index.php  index.html index.htm;
    index index.php index.html index.htm index.nginx-debian.html;

    location / {
    }

    location /hoh-bot
    {
           
           allow all;
           proxy_pass http://127.0.0.1:7823;
           proxy_http_version 1.1;
           proxy_set_header Upgrade $http_upgrade;
           proxy_set_header Connection 'upgrade';
           proxy_set_header Host $host;
           proxy_cache_bypass $http_upgrade;
       }
       location /hoh-bot-socket
       {
           proxy_pass http://127.0.0.1:7823/socket.io;
           proxy_http_version 1.1;
           proxy_set_header Upgrade $http_upgrade;
           proxy_set_header Connection "upgrade";
       }
       location /hoh2 {
           return 200 'Testng';
       }
       error_page 404 /404.html;
           location = /40x.html {
       }

    error_page 500 502 503 504 /50x.html;
        location = /50x.html {
    }

}

标签: mongodbnginxchatbotpm2

解决方案


推荐阅读