Nginx Access Denied

Source: Internet
Author: User
Tags sendfile
{Code ...}
Two days ago, I opened aws EC2 for free for one year. I wanted to buy a domain name and build my own blog trainer. It went quite well in the early stage, but it was troublesome to bind a domain name. when I visited the website, the website failed to work, and there was no problem in the log. No progress has been made after a day. please help me. Below is the content of nginx. conf. I have not configured a VM.
user www;worker_processes  1;error_log  /opt/modules/nginx/logs/error.log notice;#error_log  logs/error.log  notice;#error_log  logs/error.log  info;pid        /opt/modules/nginx/logs/nginx.pid;events {    use  epoll;    worker_connections  1024;}http {    include       mime.types;    default_type  application/octet-stream;    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '                      '$status $body_bytes_sent "$http_referer" '                      '"$http_user_agent" "$http_x_forwarded_for"';    access_log  /opt/modules/nginx/logs/access.log  main;    sendfile        on;    #tcp_nopush     on;    #keepalive_timeout  0;    keepalive_timeout  65;    #gzip  on;    server {        listen       80 default;        #charset koi8-r;        access_log  /opt/modules/nginx/logs/access.log  main;        location / {            root   html;            index  index.php index.html index.htm;        }        #error_page  404              /404.html;        # redirect server error pages to the static page /50x.html        #        error_page   500 502 503 504  /50x.html;        location = /50x.html {            root   html;        }        # proxy the PHP scripts to Apache listening on 127.0.0.1:80        #        #location ~ \.php$ {        #    proxy_pass   http://127.0.0.1;        #}        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000        #        location ~ \.php$ {            fastcgi_pass   127.0.0.1:9000;            fastcgi_index  index.php;            fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;            include        fastcgi_params;        }    }}
There is no print error in the log. I will paste the browser here to report an error:

This error is not reported in logs, and the website access status varies with browsers. When I use chrome for access, there is a chance that the access will be normal. when I use Safari, there is a chance that the access will be normal, and I cannot access it normally with IE. The website address is: http://gaochao.info
If the access is normal, the nginx welcome page is displayed. You can also try it. At the beginning of the year, I suspected that the domain name could not be properly resolved, but later I ruled out this possibility. There are two reasons: first, I tried to directly modify the hosts file, and the problem was not improved. Second, when I ping the domain name:

This shows that the domain name has been successfully resolved to my ip address. So it should not be a resolution issue. I have tried various methods, but I still cannot solve this problem. Please save me !!!

Reply content:
Two days ago, I opened aws EC2 for free for one year. I wanted to buy a domain name and build my own blog trainer. It went quite well in the early stage, but it was troublesome to bind a domain name. when I visited the website, the website failed to work, and there was no problem in the log. No progress has been made after a day. please help me. Below is the content of nginx. conf. I have not configured a VM.
user www;worker_processes  1;error_log  /opt/modules/nginx/logs/error.log notice;#error_log  logs/error.log  notice;#error_log  logs/error.log  info;pid        /opt/modules/nginx/logs/nginx.pid;events {    use  epoll;    worker_connections  1024;}http {    include       mime.types;    default_type  application/octet-stream;    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '                      '$status $body_bytes_sent "$http_referer" '                      '"$http_user_agent" "$http_x_forwarded_for"';    access_log  /opt/modules/nginx/logs/access.log  main;    sendfile        on;    #tcp_nopush     on;    #keepalive_timeout  0;    keepalive_timeout  65;    #gzip  on;    server {        listen       80 default;        #charset koi8-r;        access_log  /opt/modules/nginx/logs/access.log  main;        location / {            root   html;            index  index.php index.html index.htm;        }        #error_page  404              /404.html;        # redirect server error pages to the static page /50x.html        #        error_page   500 502 503 504  /50x.html;        location = /50x.html {            root   html;        }        # proxy the PHP scripts to Apache listening on 127.0.0.1:80        #        #location ~ \.php$ {        #    proxy_pass   http://127.0.0.1;        #}        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000        #        location ~ \.php$ {            fastcgi_pass   127.0.0.1:9000;            fastcgi_index  index.php;            fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;            include        fastcgi_params;        }    }}
There is no print error in the log. I will paste the browser here to report an error:

This error is not reported in logs, and the website access status varies with browsers. When I use chrome for access, there is a chance that the access will be normal. when I use Safari, there is a chance that the access will be normal, and I cannot access it normally with IE. The website address is: http://gaochao.info
If the access is normal, the nginx welcome page is displayed. You can also try it. At the beginning of the year, I suspected that the domain name could not be properly resolved, but later I ruled out this possibility. There are two reasons: first, I tried to directly modify the hosts file, and the problem was not improved. Second, when I ping the domain name:

This shows that the domain name has been successfully resolved to my ip address. So it should not be a resolution issue. I have tried various methods, but I still cannot solve this problem. Please save me !!!

In fact, we can see that the connection is reset, and 99% is the wall!
AWS has been walled, and you need to use a proxy to access it.

  • I am in Tokyo, using chrome and safari can both access http://gaochao.info and http: // 52.196.247.234/

  • I used IP Location to check your IP address (52.196.247.234) in Tokyo, Japan. I think the intermittent website traffic is probably caused by a wall...

  • Use cloud services in China. You can also use Hexo to build a blog and deploy it on Coding. it is free and convenient.

It is blocked and can be accessed through the wall.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.