Table of Contents
Reply content:
Home Backend Development PHP Tutorial nginx access denied

nginx access denied

Jul 06, 2016 pm 01:53 PM
linux nginx php

<code>前两天开了个aws免费一年的EC2,我就想买个域名搭个自己的博客练练手。前期都很顺利,可是在绑定域名的时候遇到了麻烦,访问网站时灵时不灵,日志里也看不到不出什么问题。折腾一天了也没什么进展,求各位大神救救俺。
下面是nginx.conf的内容,我还没有配虚拟主机。</code>
Copy after login
Copy after login
<code>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;
        }
    }
}</code>
Copy after login
Copy after login
<code>日志里没有打印错误,我这里贴下浏览器报错吧:
</code>
Copy after login
Copy after login

nginx access denied

<code>
这个错误诡异在日志没有任何的报错,而且不同的浏览器访问网站情况还不一样。我用chrome访问的时候大概有十分之一的几率访问正常,用Safari的时候却有百分之50的几率访问正常,用IE压根不能正常访问。
网站地址是:http://gaochao.info
</code>
Copy after login
Copy after login
<code>如果访问正常的话会显示nginx欢迎界面。大家也可以试试。

期初我怀疑是域名没能够正常解析,但后来我排除了这个可能。原因有两点:第一我试过直接修改hosts文件,问题没有任何改善。第二我在ping域名的时候:
</code>
Copy after login
Copy after login

nginx access denied

<code>这里显示域名已经被成功解析到我的ip了。所以应该不是解析的问题。

我已经试了各种方法了,还是没能解决这个问题。恳请各位大神救我脱离苦海啊!!!</code>
Copy after login
Copy after login

Reply content:

<code>前两天开了个aws免费一年的EC2,我就想买个域名搭个自己的博客练练手。前期都很顺利,可是在绑定域名的时候遇到了麻烦,访问网站时灵时不灵,日志里也看不到不出什么问题。折腾一天了也没什么进展,求各位大神救救俺。
下面是nginx.conf的内容,我还没有配虚拟主机。</code>
Copy after login
Copy after login
<code>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;
        }
    }
}</code>
Copy after login
Copy after login
<code>日志里没有打印错误,我这里贴下浏览器报错吧:
</code>
Copy after login
Copy after login

nginx access denied

<code>
这个错误诡异在日志没有任何的报错,而且不同的浏览器访问网站情况还不一样。我用chrome访问的时候大概有十分之一的几率访问正常,用Safari的时候却有百分之50的几率访问正常,用IE压根不能正常访问。
网站地址是:http://gaochao.info
</code>
Copy after login
Copy after login
<code>如果访问正常的话会显示nginx欢迎界面。大家也可以试试。

期初我怀疑是域名没能够正常解析,但后来我排除了这个可能。原因有两点:第一我试过直接修改hosts文件,问题没有任何改善。第二我在ping域名的时候:
</code>
Copy after login
Copy after login

nginx access denied

<code>这里显示域名已经被成功解析到我的ip了。所以应该不是解析的问题。

我已经试了各种方法了,还是没能解决这个问题。恳请各位大神救我脱离苦海啊!!!</code>
Copy after login
Copy after login

In fact, when you see the connection being reset, 99% of the time it means it is blocked!
AWS is blocked and you need to use a proxy to access it.

  • I am in Tokyo and can access http://gaochao.info and http://52.196.247.234/

  • using both chrome and safari.
  • I used IP Location to check your IP (52.196.247.234). The address is in Tokyo, Japan. I think the intermittent convulsions on the website are probably due to being blocked...

  • Switch to domestic cloud services. Or use Hexo to build a blog and deploy it to Coding, which is completely free and very convenient.

It is blocked and can be accessed by overcoming the wall.

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

BITGet official website installation (2025 beginner's guide) BITGet official website installation (2025 beginner's guide) Feb 21, 2025 pm 08:42 PM

BITGet is a cryptocurrency exchange that provides a variety of trading services including spot trading, contract trading and derivatives. Founded in 2018, the exchange is headquartered in Singapore and is committed to providing users with a safe and reliable trading platform. BITGet offers a variety of trading pairs, including BTC/USDT, ETH/USDT and XRP/USDT. Additionally, the exchange has a reputation for security and liquidity and offers a variety of features such as premium order types, leveraged trading and 24/7 customer support.

Get the gate.io installation package for free Get the gate.io installation package for free Feb 21, 2025 pm 08:21 PM

Gate.io is a popular cryptocurrency exchange that users can use by downloading its installation package and installing it on their devices. The steps to obtain the installation package are as follows: Visit the official website of Gate.io, click "Download", select the corresponding operating system (Windows, Mac or Linux), and download the installation package to your computer. It is recommended to temporarily disable antivirus software or firewall during installation to ensure smooth installation. After completion, the user needs to create a Gate.io account to start using it.

How to automatically set permissions of unixsocket after system restart? How to automatically set permissions of unixsocket after system restart? Mar 31, 2025 pm 11:54 PM

How to automatically set the permissions of unixsocket after the system restarts. Every time the system restarts, we need to execute the following command to modify the permissions of unixsocket: sudo...

Why does an error occur when installing an extension using PECL in a Docker environment? How to solve it? Why does an error occur when installing an extension using PECL in a Docker environment? How to solve it? Apr 01, 2025 pm 03:06 PM

Causes and solutions for errors when using PECL to install extensions in Docker environment When using Docker environment, we often encounter some headaches...

How to solve the permissions problem encountered when viewing Python version in Linux terminal? How to solve the permissions problem encountered when viewing Python version in Linux terminal? Apr 01, 2025 pm 05:09 PM

Solution to permission issues when viewing Python version in Linux terminal When you try to view Python version in Linux terminal, enter python...

WordPress site file access is restricted: Why is my .txt file not accessible through domain name? WordPress site file access is restricted: Why is my .txt file not accessible through domain name? Apr 01, 2025 pm 03:00 PM

Wordpress site file access is restricted: troubleshooting the reason why .txt file cannot be accessed recently. Some users encountered a problem when configuring the mini program business domain name: �...

How to make PHP5.6 and PHP7 coexist through Nginx configuration on the same server? How to make PHP5.6 and PHP7 coexist through Nginx configuration on the same server? Apr 01, 2025 pm 03:15 PM

Running multiple PHP versions simultaneously in the same system is a common requirement, especially when different projects depend on different versions of PHP. How to be on the same...

Explain late static binding in PHP (static::). Explain late static binding in PHP (static::). Apr 03, 2025 am 12:04 AM

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

See all articles