fastcgi - 将信息传递给脚本

时间:2014-07-02 20:00:00

标签: nginx symfony-1.4 fastcgi

我是nginx的新手,我甚至都不知道应该寻找什么。我的任务是强制(我认为是) fastcgi 将信息( PATH_INFO )传递给脚本。有人告诉我,我应该在 location~.php $ 之后添加一些内容。在 fastcgi_pass xxx;

之前添加
fastcgi_param PATH_INFO $fastcgi_path_info;

会发生这种情况吗?

我的位置部件配置文件如下所示:

location ~ ^/backend\.php/(.*)$ {
    try_files $uri /backend.php?$1;
}

location ~ \.php$ {
    # Zero-day exploit defense.
    # http://forum.nginx.org/read.php?2,88845,page=3
    # Won't work properly (404 error) if the file is not stored on this server, which is entirely possible with php-fpm/php-fcgi.
    # Comment the 'try_files' line out if you set up php-fpm/php-fcgi on another machine.  And then cross your fingers that you won't get hacked.
    try_files $uri =404;

    fastcgi_split_path_info ^(.+\.php)(/.+)$;

    include fastcgi_params;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_pass xxx;
}

0 个答案:

没有答案