ПРОЕКТЫ 


  АРХИВ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  СТАТЬИ 


  ПЕРСОНАЛЬНОЕ 


  ПРОГРАММЫ 



ПИШИТЕ
ПИСЬМА












     АРХИВ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Вопрос по перловому модулю и error_page


  • To: <nginx-ru@xxxxxxxxx>
  • Subject: RE: Вопрос по перловому модулю и error_page
  • From: "Igor Savchenko" <dicsydel@xxxxxxxxx>
  • Date: Tue, 11 Dec 2007 12:26:05 +0200
  • Content-language: en-us
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:references:in-reply-to:subject:date:message-id:mime-version:content-type:content-transfer-encoding:x-mailer:content-language:thread-index:x-cr-hashedpuzzle:x-cr-puzzleid; bh=4bntdVsYmltRkohZ1L+Ys9/k9v99j7LMWyyMWm+zsmo=; b=xSfbI4U5olY1YiEMoEpTCecUMQaeQ4W6+MP1QHpvMJl+kL8zI3GDTnfoeeW4wfqQ6XUes6c1GNItqFNcwkD3pFqaCdKdebzk4g/5l6bSebszpYY3gQwRgP11TRV+yql37jNqrrEOQ3lbyAMIHcH8Z4VlywcodD1r3eH1zhvqZ5w=
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:references:in-reply-to:subject:date:message-id:mime-version:content-type:content-transfer-encoding:x-mailer:content-language:thread-index:x-cr-hashedpuzzle:x-cr-puzzleid; b=kPxKYYVJczEj850gAOj4fWO2/PRMMZ/RbdKam7AyNUn3ZHVAHDA80J1c6kJrcJOKWYPKuF8fU075BBwuFkLGHIPCLbbJTvLQDpSdNJynyJeWq6iCsbXeuKNlrb17PJHBy9NuMAWW8J7jfafJ3BfnM2CPPJ3f0l/dLnPMbftZKak=
  • In-reply-to: <20071211100934.GC5350@xxxxxxxxxxxxx>
  • References: <004c01c83b4f$dc3d28f0$94b77ad0$@com> <20071211100934.GC5350@xxxxxxxxxxxxx>
  • Thread-index: Acg73jGKZya0p/2QSpCLY1QxKx6S5wAAUw8w

Вот прмимер конфига:

user www-data;
worker_processes  2;

error_log  /var/log/nginx/error.log debug;
pid        /var/run/nginx.pid;

events {
    worker_connections  2048;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;


    access_log  /var/log/nginx/access.log;


    sendfile        on;
    keepalive_timeout  30;
    tcp_nodelay        on;

    gzip  off;

    perl_modules  /var/www/perl/nginx;
    perl_require  handler.pm;

    server {
        listen       80;
        server_name  localhost;

        rewrite       ^/docs   http://docs.site.com;

        access_log  /var/log/nginx/localhost.access.log;

        location / {

        error_page   404 =302 /docs;

        }


        location = /rest/PhotoEditService {
                rewrite ^(.*)$  /rest/PhotoEditService.php   last;
        }

        location = /soap/PhotoEditService {
                rewrite  ^(.*)$  /soap/PhotoEditService.php  last;
        }

        location ~* \.php$    {
                fastcgi_pass       unix:/var/fastcgi.sock;
                fastcgi_index  index.php;

                fastcgi_intercept_errors on;

                fastcgi_connect_timeout       10;
                fastcgi_send_timeout          10;
                fastcgi_read_timeout          360;


                fastcgi_param  QUERY_STRING       $query_string;
                fastcgi_param  REQUEST_METHOD     $request_method;
                fastcgi_param  CONTENT_TYPE       $content_type;
                fastcgi_param  CONTENT_LENGTH     $content_length;

                fastcgi_param  SCRIPT_FILENAME
/var/www/www/$fastcgi_script_name;
                fastcgi_param  REQUEST_URI        $request_uri;
                fastcgi_param  DOCUMENT_URI       $document_uri;
                fastcgi_param  DOCUMENT_ROOT      /var/www/www;
                fastcgi_param  SERVER_PROTOCOL    $server_protocol;

                fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
                fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;

                fastcgi_param  REMOTE_ADDR        $remote_addr;
                fastcgi_param  REMOTE_PORT        $remote_port;
                fastcgi_param  SERVER_ADDR        $server_addr;
                fastcgi_param  SERVER_PORT        $server_port;
                fastcgi_param  SERVER_NAME        $server_name;

                client_body_buffer_size 0;

                error_page   404 =302 /offloaddocs;
                error_page   502 = @errors;
        }

        location @errors
        {
                perl Handler::RequestHandler;
        }

        # Resources
        location ~* \.(gif|jpg|jpeg|png|ttf)$ {
                perl Handler::RequestHandler;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /var/www/nginx-errors;
        }

        location = /maintenance.html {
            root   /var/www/nginx-default;
        }   


    }

}

Если выполнить запрос на location ~* \.(gif|jpg|jpeg|png|ttf)$ то перловый
модуль нормлаьно срабатывает.
Если запрос попадает @errors то пример дебаг лога я приводил.. в чем может
быть проблема?

> По идее, должно работать.


-- 
Игорь Сысоев
http://sysoev.ru




 




Copyright © Lexa Software, 1996-2009.