2016-07-12 62 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

你得到的错误是什么? –

回答