2016-07-12 63 views
1

Im web編程和我一直在我的項目中使用Xampp。我現在要使用lemp服務器。 我已經部署了一個lemp服務器(堆棧WTServer),並且我已經爲Symfony配置了一個domain.conf。問題是root指令不起作用。我看着localhost/domain.local/中的相同內容。 服務器中的歡迎頁面(index.php)。Nginx的域名.conf

這是我domain.conf:

server { 
server_name metaenlaceerp.local; 
root "c:/wtserver/www/metaenlaceerp"; 

## Access Restrictions 
allow  127.0.0.1; 
deny  all; 

location/{ 
    # try to serve file directly, fallback to app.php 
    try_files $uri /app.php$is_args$args; 
} 
# DEV 
# This rule should only be placed on your development environment 
# In production, don't include this and don't deploy app_dev.php or config.php 
location ~ ^/(app_dev|config)\.php(/|$) { 
    fastcgi_pass php_farm; 
    fastcgi_split_path_info ^(.+\.php)(/.*)$; 
    include nginx.fastcgi.conf; 
    fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 
    fastcgi_param DOCUMENT_ROOT $realpath_root; 
} 
# PROD 
location ~ ^/app\.php(/|$) { 
fastcgi_pass php_farm; 
    #fastcgi_pass unix:/var/run/php5-fpm.sock; 
    fastcgi_split_path_info ^(.+\.php)(/.*)$; 
    include nginx.fastcgi.conf; 
    fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 
    fastcgi_param DOCUMENT_ROOT $realpath_root; 
    # Prevents URIs that include the front controller. This will 404: 
    # http://domain.tld/app.php/some-path 
    # Remove the internal directive to allow URIs like this 
    internal; 
} 

# return 404 for all other php files not matching the front controller 
# this prevents access to other php files you don't want to be accessible. 
location ~ \.php$ { 
    return 404; 
} 

error_log "c:/wtserver/log/metaenlaceerp_error.log"; 
access_log "c:/wtserver/log/metaenlaceerp_access.log"; 
} 

有人可以幫我嗎?謝謝。

+0

你得到的錯誤是什麼? –

回答