AWS Nginx Started but not Serving AWS上Nginx服务器无法正常工作

Posted Grandyang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了AWS Nginx Started but not Serving AWS上Nginx服务器无法正常工作相关的知识,希望对你有一定的参考价值。

 

After install the nginx on AWS instance, and visit your public ip address, you might see the following:

This site can\'t be reached

xxx.xxx.xx take too long to respond.

 

Try the following steps to solve:

Go to EC2 Dashboard -> NETWORK & SECURITY -> Security Groups 

Select your current group, and right click, choose Edit inbound rules:

Add two items:

HTTP - TCP - 80 - Custom - 0.0.0.0/0

HTTP - TCP - 80 - Custom - ::/0

 

Then try to visit the public ip address again, hopefully it works like this:

 

 

If you try to visit your subdomain, and see the following page:

 

An error occurred.

Sorry, the page you are looking for is currently unavailable.

Please try again later.

 

Then try use the following command to check the log:

grep "error_log" /etc/nginx/* -R
tail -n 100 /var/log/nginx/error.log

 

If you see the following error:

(13: Permission denied) while connecting to upstream:[nginx]

 

Try the following command to fix:

setsebool -P httpd_can_network_connect 1

 

以上是关于AWS Nginx Started but not Serving AWS上Nginx服务器无法正常工作的主要内容,如果未能解决你的问题,请参考以下文章

tried accessing the SQLite plugin but Cordova is not available

java was started but returned exit code =-805306369

Java was started but returned exit code=13

java was started but return exit code=-805306369

java was started but returned exit code =-1

MyEclipse:Java was started but returned exit code=-1