简体   繁体   English

安装 Certbot (nginx) 后,我的域显示默认的 Amazon Linux 2 页

[英]after installing Certbot (nginx) my domain is showing default Amazon Linux 2 page

I have successfully installed certbot on amazon linux 2 and my domain has padlock but it is not showing the node app which was hosted on my domain.我已经在 amazon linux 2 上成功安装了 certbot,我的域有挂锁,但它没有显示托管在我的域上的节点应用程序。 now it is showing default amazon linux 2 page.现在它显示默认的亚马逊 linux 2 页。 before installing certbot my domain was showing the currect app.在安装 certbot 之前,我的域显示了当前的应用程序。 I still can access the app through the IP address and Port number.我仍然可以通过 IP 地址和端口号访问该应用程序。

I found the answer the problem was /etc/nginx/nginx.conf file wasn't configured for 443 port.我找到了答案,问题是 /etc/nginx/nginx.conf 文件没有为 443 端口配置。 it was redirecting to default app for the 443 ssl port.它被重定向到 443 ssl 端口的默认应用程序。 after adding the following code in server part of this file it resolved the issue.在此文件的服务器部分添加以下代码后,问题就解决了。

location / {
    proxy_pass http://localhost:3000; #chage port according to your app
    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;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM