歡迎您光臨本站 註冊首頁

nginx 無法添加虛擬主機, 求救!!

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

nginx 無法添加虛擬主機, 求救!!

大家好...

今天我添加了一個虛擬主機,但是總是不生效,然後其他的都很正常.cat /usr/local/nginx/conf/nginx.conf
include /usr/local/nginx/conf/conf.d/www.aaaaa.com/*.confcat /usr/local/nginx/conf/conf.d/www.aaaaa.com/www.aaaaa.com.conf

server {
        listen       80;
        server_name www.aaaaa.com aaaaa.com;
        root   /data/htdocs/www.aaaaa.com;
        index  index.html index.htm index.php;

        if ($host = aaaaa.com) {
                rewrite        "^/(.*)$" http://www.aaaaa.com permanent ;
        }


        if (!-e $request_filename) {
                rewrite .*(?:global.asa|default\.ida|root\.mdb|.iso|.exe|.rmvb|\.\.).* . last ;

                rewrite "^/dj/(\d+)_(\d+).html$" /html/dj/$1/$2.html last ;
                rewrite "^/v/(\d+)_(\d+).html$" /html/v/$1/$2.html last ;
                rewrite "^/list/(\d+)_(\d+).html$" /html/list/$1_$2.html last ;
                rewrite "^/tag/(.+?).html$" /search.php\?w=$1 last ;
                rewrite "^/top/(\d+)_(\d+)_(\d+).html$" /html/top/$1_$2_$3.html last ;
        }

        error_page  500 502 503 504 /50x.html ;
        location = /50x.html {
                root html;
        }
       
        location ~ \.php$ {
                fastcgi_pass  unix:/tmp/php-cgi.sock;
                #fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME  /data/htdocs/www.aaaaa.com$fastcgi_script_name;
                include fastcgi_params;
        }
       
        access_log  /data/logs/www.aaaaa.com.access.log  main;
}

請問這是什麼情況?   各位有經驗的朋友,請救救我...
《解決方案》

啟動服務之後,日誌文件被創建出來了,但是沒有任何日誌信息...
我也沒有辦法判斷....

/usr/local/nginx/sbin/nginx -t   
2011/08/05 14:09:06 25081#0: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
2011/08/05 14:09:06 25081#0: the configuration file /usr/local/nginx/conf/nginx.conf was tested successfully

怎麼辦?
《解決方案》

nginx服務能啟動不?檢查下系統日誌
《解決方案》

/usr/local/nginx/sbin/nginx -t  測試下,哪行在報錯

[火星人 ] nginx 無法添加虛擬主機, 求救!!已經有239次圍觀

http://coctec.com/docs/service/show-post-14212.html