Generating redirects to internal named locations
dave at jetcafe.org
Wed Aug 10 06:28:09 UTC 2011
Alexandr Gomoliako <zzz at zzz.org.ua> writes:
> On 8/8/11, Dave Hayes <dave at jetcafe.org> wrote:
>> If I have several location blocks in a server block, and I want to use
>> just one location block that has my fastcgi definitions for perl (hence
>> @perl), are you recommending I just duplicate all the configuration
>> in each location block that needs to redirect to perl?
>> Did I get that right? :)
> Yes, you got that right :)
> Avoiding abstractions is a good thing here. Less likely to stumble on
> a bug, easier to read later, etc.
Interesting. I would like to learn more about why you think this is a
best practice. Please don't misread, this is not a criticism. I am quite
curious about any new way of thinking that goes exactly opposite to
In this case, many software developers will tell you that factoring out
common lines of configuration as I have suggested prevents bugs and is
easier to read.
In my example above, if I misconfigure the perl section, I only have to
fix it in one place. If I do it the way you suggest, pasting that
configuration into 20 different location blocks, I have to fix any
configuration bug in 20 places. If I change one location slightly,
it may be hard to spot that there's a bug in that location.
Maybe I am misunderstanding your rationale? :)
Dave Hayes - Consultant - Altadena CA, USA - dave at jetcafe.org
>>> The opinions expressed above are entirely my own <<<
"Every extreme attitude is a flight from the self."
-- Eric Hoffer
More information about the nginx