Welcome! Log In Create A New Profile

Advanced

Re: Possible bug with -f test

June 10, 2010 02:36PM
On Thu, Jun 10, 2010 at 01:56:19PM -0400, bkirkbri wrote:

> I'm seeing a problem with static file handling when using multiple -f tests in a location block. I could be doing something stupid, but from the debug log it looks like a bug is corrupting the pathname nginx uses to serve the static file...
>
> The corrupt filename should be "/tmp/home.html" but is in the debug log as:
> [code]
> 2010/06/10 13:12:22 [debug] 15629#0: *3 http filename: "/tmp/home.htmlTP/1.1
> Host"
> [/code]
>
> This is for nginx-0.7.66 compiled with: --with-http_realip_module --with-debug
>
> Config:
> [code]
> server {
> listen 174.37.76.178:80;
> listen 10.16.10.202:80;
> #listen 208.101.17.12:80;
> server_name _;
>
> set $path_a /var/www/otherpeoplespixels.com/sites/content;
>
> location ~ ^/(.+\.html)$ {
> alias /tmp/$1;
> expires 1m;
> log_not_found off;
> #error_page 404 = @catalyst;
>
> set $is_down no;
> if ( -f /tmp/$host/.down ) {
> set $is_down yes;
> }
> if ( -f $path_a/$host/.grace_period ) {
> set $is_down no;
> }
> if ( $is_down = yes ) {
> return 503;
> }
> }
>
> }
>
> }
> [/code]

The bug is in "alias/if" combination. "root" should work:

location ~ \.html$ {
root /tmp;
...


--
Igor Sysoev
http://sysoev.ru/en/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Possible bug with -f test

bkirkbri June 10, 2010 01:56PM

Re: Possible bug with -f test

Igor Sysoev June 10, 2010 02:36PM

Re: Possible bug with -f test

bkirkbri June 10, 2010 02:55PM

Re: Possible bug with -f test

Igor Sysoev June 10, 2010 03:16PM

Re: Possible bug with -f test

bkirkbri June 10, 2010 05:50PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 228
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready