myvapour 发表于 2013-7-28 19:25:08

配置域名只能访问根目录

只能访问根目录,下的单个文件,如,www.xxx.com/p.php能访问,而不能访问下面的文件夹,比如说,www.xxx.com/install这个目录就不能访问,通过IP访问却是正常的,这样我网站程序都安装不了,这是我网站域名配置,哪里有错么server
      {
                listen       80;
                server_name www.xxx.com;
                index index.html index.htm index.php default.html default.htm default.php;
                root/home/wwwroot/xxx;

                                 error_page 404 /404.html;
                include none.conf;
                location ~ .*\.(php|php5)?$
                        {
                              fastcgi_passunix:/tmp/php-cgi.sock;
                              fastcgi_index index.php;
                              include fcgi.conf;
                        }

               

                location ~ .*\.(js|css)?$
                        {
                              expires      12h;
                        }
                                     location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
                        {
                              valid_referers none blocked *.xxx.com;
                              if ($invalid_referer) {
                              rewrite ^/ http://img181.poco.cn/mypoco/myphoto/20110603/22/452091912011060322045809.jpg;
                              #return 404;
                              }
                              expires      30d;
                        }

                access_log off;
      }这是ngnix.conf的内容userwww www;

worker_processes 3;

error_log/home/wwwlogs/nginx_error.logcrit;

pid      /usr/local/nginx/logs/nginx.pid;

#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;

events
      {
                use epoll;
                worker_connections 51200;
      }

http
      {
                include       mime.types;
                default_typeapplication/octet-stream;

                server_names_hash_bucket_size 128;
                client_header_buffer_size 32k;
                large_client_header_buffers 4 32k;
                client_max_body_size 50m;

                sendfile on;
                tcp_nopush   on;

                keepalive_timeout 60;

                tcp_nodelay on;

                fastcgi_connect_timeout 300;
                fastcgi_send_timeout 300;
                fastcgi_read_timeout 300;
                fastcgi_buffer_size 64k;
                fastcgi_buffers 4 64k;
                fastcgi_busy_buffers_size 128k;
                fastcgi_temp_file_write_size 256k;

                gzip on;
                gzip_min_length1k;
                gzip_buffers   4 16k;
                gzip_http_version 1.0;
                gzip_comp_level 2;
                gzip_types       text/plain application/x-javascript text/css application/xml;
                gzip_vary on;
                gzip_proxied      expired no-cache no-store private auth;
                gzip_disable      "MSIE \.";

                #limit_zonecrawler$binary_remote_addr10m;

                server_tokens off;
                #log format
                log_formataccess'$remote_addr - $remote_user [$time_local] "$request" '
             '$status $body_bytes_sent "$http_referer" '
             '"$http_user_agent" $http_x_forwarded_for';

server
      {
                listen       80;
                server_name www.xxx.com;
                index index.html index.htm index.php default.html default.htm default.php;
                root/home/wwwroot/xxx;

                location ~ .*\.(php|php5)?$
                        {
                              try_files $uri =404;
                              fastcgi_passunix:/tmp/php-cgi.sock;
                              fastcgi_index index.php;
                              include fcgi.conf;
                        }

                location /status {
                        stub_status on;
                        access_log   off;
                }

                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
                        {
                              expires      30d;
                        }

                location ~ .*\.(js|css)?$
                        {
                              expires      12h;
                        }

                access_log/home/wwwlogs/access.logaccess;
      }
include vhost/*.conf;
}

[ 本帖最后由 myvapour 于 2013-7-28 20:21 编辑 ]

licess 发表于 2013-7-28 20:17:14

不能访问什么错误信息?
什么程序

配置里没错误

myvapour 发表于 2013-7-28 20:19:38

回复 2# 的帖子

服务器错误
网站在检索 http://www.xxx.com/e/install/ 时遇到错误。 该网站可能关闭进行维护或配置不正确。
以下是一些建议:
请稍后重新加载此网页。
HTTP 错误 500(Internal Server Error):服务器尝试执行请求时遇到了意外情况。



只提示这个错误,帝国CMS,IP访问是正常的!

myvapour 发表于 2013-7-28 21:11:46

回复 2# 的帖子

ngnix.conf里的域名如果改成自己的域名二级目录也打不开,如果用www.lnmp.org就没事!

myvapour 发表于 2013-7-28 21:37:00

回复 2# 的帖子

找到问题了,文件夹必须是www.xxx.com

root/home/wwwroot/www.dasuzhong.com;

如果换成别的文件夹就不行!
页: [1]
查看完整版本: 配置域名只能访问根目录