Welcome! Log In Create A New Profile

Advanced

No such file or directory errors, nginx hang after a few hours

December 06, 2009 12:44AM
Hi,

I am pretty new to nginx so I am pretty sure I must do something wrong here.

Basically, I am using nginx as a proxy cache but nginx only read in a given directory, if the file is not found, nginx proxy pass to the app which return the file and write to the directory so next time Nginx can get it directly.

The issue is that when the file is not in the directory yet, nginx throws an error like that:

2009/12/06 06:16:15 [error] 16804#0: *19879 open() "/opt/datastore/68/alt:strip-details.jpg" failed (2: No such file or directory)

And as you can guess, i got ton of them... So I disabled the error log, well i put it to log crit level only. But I am pretty sure there is a cleaner way to deal with this.

My nginx.conf is pretty simple. I have a few rewrite rules to convert an uri to a given file path then I catch the 404 errors.

server {

# Regular config stuff....

#Render
if ($args ~* ([a-z_]+)=(\d+).type=(.*).v=(\d+))
{
set $args $1/$2/$3;
rewrite "/render/screenshot.jspa" /wow/render/$args.jpg;
}

location / {
root /opt/datastore;
index index.html index.htm;
error_page 404 = /fallback;
}

location = /fallback {
# only internal requests can reach this endpoint
internal;

# proxy config
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

# dispatch to haproxy
proxy_pass http://172.31.1.9;
}
}


And somehow, after a few hours, nginx hang which might be tied with all those failed open files error or not, I dont know at this point. I just re enabled all errors to see if there is something unusual in the log once it hangs.

I am using Nginx 0.8.24 on Opensolaris snv127

Thanks in advance for your help.
Chris
SubjectAuthorPosted

No such file or directory errors, nginx hang after a few hours

TlvennDecember 06, 2009 12:44AM

Re: No such file or directory errors, nginx hang after a few hours

arty777March 05, 2013 05:48AM

Re: No such file or directory errors, nginx hang after a few hours

arty777March 05, 2013 05:50AM

Re: No such file or directory errors, nginx hang after a few hours

Maxim DouninMarch 05, 2013 08:02AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 113
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 229 on August 01, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready