try_files is broken with geoip?

Peter Volkov peter.volkov at gmail.com
Mon Mar 30 19:50:31 UTC 2015


On Mon, Mar 30, 2015 at 10:18 PM, Francis Daly <francis at daoine.org> wrote:

> On Mon, Mar 30, 2015 at 08:26:13PM +0300, Peter Volkov wrote:
>
> Hi there,
>
> > We experience problem: if inside location we use geoip variable try_files
> > is not working and only root location is looked up for files.
>
> That is working as expected for "if" inside "location". It's unrelated
> to geoip.
>
> http://wiki.nginx.org/IfIsEvil
>
> Third item:
>
>         # try_files wont work due to if
>
>         location /if-try-files {
>              try_files  /file  @fallback;
>
>              set $true 1;
>
>              if ($true) {
>                  # nothing
>              }
>         }
>
> You'll want to redesign whatever you are doing not to use "if" inside
> "location" for anything other than "return" or effective equivalents.
>

Hell, true! Thank you, Francis!

--
Peter.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20150330/a086e18c/attachment.html>


More information about the nginx mailing list