开发者社区> 问答> 正文

nginx拒绝访问

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

日志里没有打印错误,我这里贴下浏览器报错吧:
screenshot

展开
收起
a123456678 2016-06-28 14:56:36 4583 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
《Nginx 代理系统常用手册》 立即下载
CentOS Nginx PHP JAVA 多语言镜像使用手 立即下载
CentOS Nginx PHP JAVA多语言镜像使用手册 立即下载