Проблема с 404 и fastcgi

Andrei Nigmatulin anight at monamour.ru
Fri Aug 26 16:00:41 MSD 2005


Добрый день, Игорь!

Есть вот такая конфигурация:

    fastcgi_index index.phtml;
    fastcgi_redirect_errors on;

    server {
        listen  80;

        location / {
            root   html;
            index  index.html index.htm;
        }

        # serve php scripts
        location ~ (/$|\.phtml$|\.php$) {
            fastcgi_param   DOCUMENT_ROOT     $document_root;
            fastcgi_param   PATH_TRANSLATED   $document_root/$fastcgi_script_name;
            fastcgi_param   SCRIPT_NAME       $fastcgi_script_name;
            fastcgi_param   QUERY_STRING      $query_string;
            fastcgi_param   SERVER_NAME       $server_name;
            fastcgi_param   REQUEST_URI       $request_uri;
            fastcgi_param   DOCUMENT_URI      $document_uri;
            fastcgi_param   REQUEST_METHOD    $request_method;
            fastcgi_pass 127.0.0.1:8002;
        }

        error_page 404 =200 /404.phtml ;
    }

Как видно, все запросы, которые заканчиваются на "/" обрабатываются через fastcgi (/index.phtml).

1) при запросе /non-existent отрабатывает скрипт 404.phtml.
2) при запросе /non-existent/ вижу сообщение "No input file specified". Хочется чтобы эти запросы тоже обрабатывались скриптом /404.phtml. Как это можно сделать ?

-- 
Andrei Nigmatulin
GPG PUB KEY 6449830D

No Microsoft products were used in any way
for the creation of this message. If you are
using a Microsoft product to view it, BEWARE!
I'm not responsible for any harm you might
encounter as a result.


More information about the nginx-ru mailing list