2016-03-02 60 views
0

我對Nginx服務器有問題,因爲它只顯示默認頁面。虛擬主機和主機文件似乎沒問題。我不明白問題在哪裏。Nginx服務器只顯示默認頁面

這裏是我的虛擬主機配置:

server { 
    listen 80; 
    listen [::]:80; 
    listen 443 default ssl; 
    server_name marketplace_unirgy; 
    ssl_certificate /etc/nginx/ssl/nginx.crt; 
    ssl_certificate_key /etc/nginx/ssl/nginx.key; 
    root /var/www/html/marketplace_unirgy/; 
    index index.php; 
    #location/{ 
    #  index index.html index.php; 
    #  autoindex on; 
    #  #If missing pass the URI to Magento's front handler 
    #  try_files $uri $uri/ @handler; 
    #  expires max; 
    #} 
    #need it to execute php 
    location ~ \.php$ { 
      fastcgi_pass unix:/var/run/php5-fpm.sock; 
      include fastcgi_params; 
      include fastcgi.conf; 
    } 
    ## Magento uses a common front handler 
    location @handler { 
      rewrite//index.php; 
    } 
} 

而且我的主機:

127.0.0.1 marketplace_unirgy localhost 

我的網站是在/var/www/html/marketplace_unirgy

回答

0

你似乎有註釋掉由於某種原因,默認位置。嘗試使用使其:

location/{ 
    try_files $uri $uri/ /index.php; 
} 

更多見thisthis

+0

感謝您幫助我在magento數據庫中出現'core_config_data'字段'patht'的問題。如果此值未正確設置,您的網址將重定向到此字段中的值。它對我隱藏了。 – kino