2012-09-27 19 views
0

我試圖建立在wiki.lightenedblade.com維基當我嘗試去鏈接,它給了我一個404的消息設置了一個wiki,但nginx的是給我的問題

然而,我configs和LocalSettings文件似乎只是爲了不是nginx配置。這裏是我的Nginx CONFIGS:

server { 
      listen 80; 
      server_name lightenedblade.com www.lightenedblade.com; 
      root /home/metalmine/public_html/lightenedblade; 

      location/{ 
        autoindex on; 
        index index.html; 
      } 
     location ~ \.php$ { 
        fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; 
        fastcgi_index index.php; 
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
        autoindex on; 
        index index.php; 
        include  fastcgi.conf; 
     } 

    } 

    server { 
      server_name wiki.lightenedblade.com; 
      root /home/metalmine/public_html/lightenedblade/w; 

      # Location for the wiki's root 
     location/{ 
      # Do this inside of a location so it can be negated 
      location ~ \.php$ { 
       try_files $uri $uri/ =404; # Don't let php execute non-existent php files 
       include /etc/nginx/fastcgi_params; 
       fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; 
      } 
     } 

     location /images { 
      # Separate location for images/ so .php execution won't apply 

      location ~ ^/images/thumb/(archive/)?[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ { 
       # Thumbnail handler for MediaWiki 
       # This location only matches on a thumbnail's url 
       # If the file does not exist we use @thumb to run the thumb.php script 
       try_files $uri $uri/ @thumb; 
      } 
     } 
     location /images/deleted { 
      # Deny access to deleted images folder 
      deny all; 
     } 

     # Deny access to folders MediaWiki has a .htaccess deny in 
     location /cache  { deny all; } 
     location /languages { deny all; } 
     location /maintenance { deny all; } 
     location /serialized { deny all; } 

     # Just in case, hide .svn and .git too 
     location ~ /.(svn|git)(/|$) { deny all; } 

     # Hide any .htaccess files 
     location ~ /.ht { deny all; } 

     # Uncomment the following code if you wish to hide the installer/updater 
     ## Deny access to the installer 
     #location /mw-config { deny all; } 

     # Handling for the article path 
     location /wiki { 
      include /etc/nginx/fastcgi_params; 
      # article path should always be passed to index.php 
      fastcgi_param SCRIPT_FILENAME $document_root/index.php; 
      fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; 
     } 

     # Thumbnail 404 handler, only called by try_files when a thumbnail does not exist 
     location @thumb { 
      # Do a rewrite here so that thumb.php gets the correct arguments 
      rewrite ^/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /thumb.php?f=$1&width=$2; 
      rewrite ^/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /thumb.php?f=$1&width=$2&archived=1; 

      # Run the thumb.php script 
      include /etc/nginx/fastcgi_params; 
      fastcgi_param SCRIPT_FILENAME $document_root/thumb.php; 
      fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; 
     } 

    } 

這是我的LocalSettings:https://gist.github.com/3794836

謝謝您的時間。

回答

0

你到底有什麼問題?

我注意到謝勝利,「服務器」是不是「聽」 ......你有服務器名稱,而不是聽80例如...

嘗試nginx的-t

它通常告訴你如果在配置和錯誤的地方出現問題!

EDIT(評論不是很可讀)

404沒有找到......所以,該服務器監聽,但沒有找到您請求的頁面(1)。

我注意到你也有:「指數*」

location/{ 
      # Do this inside of a location so it can be negated 
      location ~ \.php$ { 
       try_files $uri $uri/ =404; # Don't let php execute non-existent php files 

(1)您所請求的移動網站,這樣的nginx將尋找與「根」

,但你不有一個「index.php」

您可以添加「index index.php;」假設移動網站是PHP的,當然index.php文件存在

希望這能解決你的問題

+0

當我嘗試去鏈接,它給了我一個404的消息。我添加了聽,但是這似乎不是問題 –

+0

404沒有找到...所以服務器正在偵聽,但沒有找到您請求的頁面。 我注意到你也有: 位置/ { #做到這一點的位置內,因此它可以被否定 位置〜\ .PHP $ { try_files $ URI $ URI/= 404; #不要讓php執行不存在的php文件 但是您沒有「index.php」 您可以添加「index index.php;」假設手機網站是PHP和文件index.php當然存在 希望這可以解決你的問題 – Mikec

相關問題