Passing request directly to named location

Igor Sysoev igor at
Fri Feb 11 14:38:30 MSK 2011

> > The lesser you have dependences, the lesser you
> > will have maintence
> > issues in future. Yes, you have to write more, but
> > you see what
> > how exactly this location is handled. If you ever
> > need to change
> > proxied server address, your favourite editor with
> > find/replace
> > functionality is your friend.
> Thanks but I prefer to centralise things so that I only have to edit in
> one place and not run the risk of missing stuff out.

I heard this "centralise" mantra many times. Believe me, it works until
your configuration fits on screen or two. When it grows, every, note,
EVERY configuration modification becames investigation of
configuration dependences. I have an configuraiton with 180 locaitons.
When I need to add some functionality, I simply add location and
that is all. I do not look through whole 90K file.

Why ? Because I

1) use only locations without regex.
2) do not use rewrite's at all.

If I need to change a proxied server name or something else, I use simple
find/replace in VIM. This is very easy, it's much easy than investigation
of configuration dependences on every change.

> So in terms of the try files and error page options, can you advise
> which is better ... taking note of what you said about doing each proxy
> pass every time?

error_page is faster because it does not make syscall.

Igor Sysoev

More information about the nginx mailing list