简体   繁体   中英

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. now it is showing default amazon linux 2 page. before installing certbot my domain was showing the currect app. I still can access the app through the IP address and Port number.

I found the answer the problem was /etc/nginx/nginx.conf file wasn't configured for 443 port. it was redirecting to default app for the 443 ssl port. 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;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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