我有一个 redhat Ec2 实例。我有一个简单的 Express 应用程序在端口 3000
上运行。我安装了 nginx 并且它运行正常,因为我能够将 s3 存储桶静态站点代理到我正在使用的其他子域。但是,当我尝试将 Express 应用程序代理到我的子域之一时,我不断收到 nginx 失败页面。这是我正在使用的 nginx 配置 block :
server {
listen 80;
listen api.subdoamin.com:80;
server_name api.grouve.tech;
root /usr/share/nginx/html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
proxy_pass http://00.000.00.000:3000;
expires 1y;
log_not_found off;
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;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
最佳答案
感谢@DusanBajic,答案是sudo setenforce 0
关于node.js - 无法让 Node 服务器代理到 RedHat Ec2 实例上的 nginx,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44374766/