try_files is broken with geoip?

itpp2012 nginx-forum at nginx.us
Mon Mar 30 21:11:44 UTC 2015


Peter Volkov Wrote:
-------------------------------------------------------
> On Mon, Mar 30, 2015 at 8:45 PM, itpp2012 <nginx-forum at nginx.us>
> wrote:
> 
> > Peter Volkov Wrote:
> > [...]
> > root /tmp/test/;
> > "/tmp/test/test/1.ts" -> 404
> >
> > /tmp/test has follofing files:
> > /tmp/test/dir2/test/1.ts - file
> > /tmp/test/dir1/test - directory
> >
> > looks up /tmp/test/dir1/test/1.ts or if it not exist
> > /tmp/test/dir2/test/1.ts file.
> > [...]
> >
> > I think you first need to sort out WHERE stuff is (root+uri) as your 404
is
> > valid against the other paths your have mentioned.
> 
> Sorry, I don't understood your answer. Could you explain what you
> mean, please?

The 404 is about /tmp/test/test/1.ts (root+uri) however every other path you
want to test for is not in there, so its going to fail always, maybe if you
set root /tmp/; try_files could work.

> We use *try_files /dir1$uri /dir2$uri =404;* directive to lookup file
first
> in dir1 and if file does not exist in dir1/temp/, then lookup in
dir2/temp.

You could do a fallback 'try_files $uri $uri/ @fallback;' and then test
again with a different root setting.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,257753,257762#msg-257762



More information about the nginx mailing list