error_page and Content-Length: 0

ash2k - ash2kk gmail.com
16 08:35:58 MSK 2009


   

        location = /d {
                set                             $box_filename
dontexist.png;
                set                             $box_newMaxWidth 100;
                set                             $box_newMaxHeight 100;
                set                             $box_cutHeight 0;
                error_page                      404 @boxUniversal404;
                mogilefs_domain                 <domain>;
                mogilefs_methods                GET;
                mogilefs_tracker                <ip>:<port>;
                mogilefs_pass $box_filename {
                    proxy_pass                  $mogilefs_path;
                    proxy_hide_header           Content-Type;
                    proxy_buffering             off;
                }
        }

    .    mogilefs_module. 
     Content-Length  PHP.

14  2009 . 16:13  ash2k - <ash2kk at gmail.com> :
> !     .
>
> FreeBSD 7.2-STABLE amd62, nginx/0.7.64
> -------------------------------------------
> $ telnet 127.0.0.1 5190
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is '^]'.
> GET /a HTTP/1.0
>
> HTTP/1.1 200 OK
> Server: nginx
> Date: Mon, 14 Dec 2009 10:32:34 GMT
> Content-Type: image/png
> Connection: close
> -------------------------------------------
> $ telnet 127.0.0.1 5190
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is '^]'.
> GET /b HTTP/1.0
>
> HTTP/1.1 404 Not Found
> Server: nginx
> Date: Mon, 14 Dec 2009 10:38:20 GMT
> Content-Type: image/png
> Connection: close
> -------------------------------------------
> $ telnet 127.0.0.1 5190
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is '^]'.
> GET /c HTTP/1.0
>
> HTTP/1.1 404 Not Found
> Server: nginx
> Date: Mon, 14 Dec 2009 10:40:10 GMT
> Content-Type: image/png
> Content-Length: 0
> Connection: close
> -------------------------------------------
>     "Content-Length: 0" -  PHP 
>       fastcgi_hide_header Content-Length  
> .
>       PNG,   
>     - "Content-Length: 0" .
>    (/c) location:
> 1.    mogilefs  
> 2.  404   @boxMogilefs
> 3. PHP   404
> 4.  404   @boxUniversal404
> 5. PHP  PNG
>
> :
>
> server {
>    listen                 127.0.0.1:5190
> default;
>    access_log               off;
>    proxy_intercept_errors         on;
>    fastcgi_intercept_errors        on;
>    recursive_error_pages          on;
>    error_page               404
> /img/imagenotfound.png;
>
>    location /img/ {
>      root                /home/cropbox/www/linkme;
>    }
>
>    location = /a {
>        set               $box_source
> /home/app_cropbox/img/imagenotfound.png;
>        include             fastcgi_params;
>        fastcgi_param          SCRIPT_FILENAME
> /home/app_cropbox/cropbox/boxUniversal.php;
>        fastcgi_param          QUERY_STRING
> source=$box_source&newMaxWidth=100&newMaxHeight=100&cutHeight=0;
>        fastcgi_pass          cropbox;
>    }
>    location = /b {
>        error_page           404 @boxUniversal404;
>        set               $box_filename
> donotexist.png;
>        set               $box_newMaxWidth 100;
>        set               $box_newMaxHeight 100;
>        set               $box_cutHeight 0;
>        return 404;
>    }
>    location = /c {
>        set               $box_filename dontexist.png;
>        set               $box_newMaxWidth 100;
>        set               $box_newMaxHeight 100;
>        set               $box_cutHeight 0;
>        error_page           404 = @boxMogilefs;
>        mogilefs_domain         <domain>;
>        mogilefs_methods        GET;
>        mogilefs_tracker        <ip>:<port>;
>        mogilefs_pass $box_filename {
>          proxy_pass         $mogilefs_path;
>          proxy_hide_header      Content-Type;
>          proxy_buffering       off;
>        }
>    }
>    location @boxUniversal404 {
>        set               $box_source
> /home/app_cropbox/img/imagenotfound.png;
>        error_page           404 /img/imagenotfound.png;
>        include             fastcgi_params;
>        fastcgi_param          SCRIPT_FILENAME
> /home/app_cropbox/cropbox/boxUniversal.php;
>        fastcgi_param          QUERY_STRING
> source=$box_source&newMaxWidth=$box_newMaxWidth&newMaxHeight=$box_newMaxHeight&cutHeight=$box_cutHeight;
>        fastcgi_pass          cropbox;
>    }
>    location @boxMogilefs {
>        error_page           404 @boxUniversal404;
>        include             fastcgi_params;
> #        fastcgi_hide_header       Content-Length;
>        fastcgi_param          SCRIPT_FILENAME
> /home/app_cropbox/cropbox/boxMogilefs.php;
>        fastcgi_param          QUERY_STRING
> filename=$box_filename&newMaxWidth=$box_newMaxWidth&newMaxHeight=$box_newMaxHeight&cutHeight=$box_cutHeight;
>        fastcgi_pass          cropbox;
>    }
> }
>


nginx-ru