NGINX sef URL错误:未指定输入文件

NGINX sef URL错误:未指定输入文件,nginx,Nginx,我一直在努力使用NGINX配置。我已经建立了一个开发环境(本地笔记本电脑),配置支持搜索引擎友好型(SEF)URL,但相同的配置似乎在我的测试服务器上不起作用 本地配置: server { server_name example; root /home/arciitek/git/example/public; client_max_body_size 500M; location /collection/ { try_files $u

我一直在努力使用NGINX配置。我已经建立了一个开发环境(本地笔记本电脑),配置支持搜索引擎友好型(SEF)URL,但相同的配置似乎在我的测试服务器上不起作用

本地配置:

server {
    server_name  example;

    root   /home/arciitek/git/example/public;

    client_max_body_size 500M;


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

    location / {
        index  index.html index.htm index.php;
        try_files $uri $uri/ /index.php?q=$uri&$args;
    }

    location ~ \.php$ {
    include /etc/nginx/fastcgi_params;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME /home/arciitek/git/example/public/$fastcgi_script_name;
    }
}
这个很好用。现在在测试环境中,它看起来是这样的:

{
    server_name dev.example.com;

    access_log /srv/www/dev.example.com/access.log;
    error_log /srv/www/dev.example.com/error.log debug;
    root /srv/www/dev.example.com/public;

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

    location / {
        index  index.html index.htm index.php;
        try_files $uri $uri/ /index.php?q=$uri&$args;
    }

    location ~ \.php$ {
        include /etc/nginx/fastcgi_params;
        fastcgi_pass unix:/var/run/php-fastcgi/php-fastcgi.socket;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME /srv/www/dev.example.com/public$fastcgi_script_name;
}
}

在我的开发环境中,一切都很好。但在我的测试环境中,当我在浏览器中调用添加了prettyness的url时:collection/[brand]/[product]。我得到:
未指定输入文件
错误。请注意,如果我调用url,则与收集/每件事相关的anding也会起作用

有人能帮我吗?如果需要更多信息,请告诉我

亲切问候,


Erik

在经历了很长一段时间的挫折之后,我注意到给我带来麻烦的不是配置,而是站点链接启用了


好了*把自己背在背上…

你错过了
SCRIPT\u FILENAME
中的斜杠了吗?嗨,Alexey,谢谢你的回复。我试过用斜杠和不用斜杠,但似乎没什么区别。。。我还尝试了$document\u root$fastcgi\u script\u name;但这也不起作用