Symfony使用Nginx将用户重定向到主页

时间:2015-07-09 22:12:57

标签: symfony nginx

这可能与symfony的nginx配置有关,但我很确定symfony开发人员可能知道这个问题的答案

server {
server_name dev.some.com;
root /var/www/some/web;

location / {
    # try to serve file directly, fallback to app.php
    try_files $uri /app_dev.php$is_args$args;
}

proxy_buffer_size    128k;
proxy_buffers     4 256k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;

# 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 unix:/var/run/php5-fpm.sock;
    fastcgi_split_path_info ^(.+\.php)(/.*)$;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param HTTPS off;
}

这是virtualhost的nginx配置。我们的网站主页访问了“dev.some.com/main'”。所以,我想配置nginx,这样如果没有传递参数,那么它应该将用户转发到/ main。

我尝试过几次重写规则,但没有运气。有什么想法吗?

0 个答案:

没有答案