给定以下文件夹结构
- www/website
-- public
--- index.php
--- otherscript.php
以及下面的nginx.conf
server {
listen 8000;
server_name localhost;
root /www/website/public;
index index.php;
# optionally disable falling back to PHP script for the asset directories;
# nginx will return a 404 error when files are not found instead of passing the
# request to Symfony (improves performance but Symfony's 404 page is not displayed)
location / {
# try to serve file directly, fallback to index.php
try_files $uri /index.php$is_args$args;
}
# would always refer to index.php (server directive)
location ~ \.php$ {
## tried this - no dice
fastcgi_pass 127.0.0.1:9001;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
index $fastcgi_script_name;
}
location ~ ^/index\.php(/|$) {
fastcgi_pass 127.0.0.1:9001;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
internal;
}
}
我希望能够在不重定向到index.php的情况下执行localhost:8000/otherscript.php。
我怎么能不破坏symfony的路由呢?