Welcome! Log In Create A New Profile

Advanced

Good Directive vs Bad Directives

Posted by antituhan 
antituhan
Good Directive vs Bad Directives
April 24, 2012 05:40PM
Hello fellas,

I've read on http://wiki.nginx.org/Pitfalls, what the different between bad
and good? Any info related to this issue? Such as cpu load or mem load?

-----
[[email protected] ~]#
--
View this message in context: http://nginx.2469901.n2.nabble.com/Good-Directive-vs-Bad-Directives-tp7496293p7496293.html
Sent from the nginx mailing list archive at Nabble.com.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
antituhan
Re: [ASK] Good Directive vs Bad Directives
April 30, 2012 11:30PM
*bump*

-----
[[email protected] ~]#
--
View this message in context: http://nginx.2469901.n2.nabble.com/ASK-Good-Directive-vs-Bad-Directives-tp7496293p7515099.html
Sent from the nginx mailing list archive at Nabble.com.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Francis Daly
Re: Good Directive vs Bad Directives
May 01, 2012 07:50PM
On Tue, Apr 24, 2012 at 08:30:18AM -0700, antituhan wrote:

Hi there,

> I've read on http://wiki.nginx.org/Pitfalls, what the different between bad
> and good? Any info related to this issue? Such as cpu load or mem load?

The short version is: if you don't understand them, just don't do the
bad ones.

The more useful information is:

that's a wiki, so what I see when I read it now may not be what you saw
when you read it. And it might be different tomorrow. And I'm not going
to help the archaeologists by being explicit ;-)

But reading that page right now, the first item seems described as a
possible configuration maintainability problem; the second item seems
the same -- basically "don't repeat what you don't need to repeat";
the third item is described as processor-inefficient; the fourth item
doesn't say why but just says "use try_files".

Is any specific one unclear to you?

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
antituhan
Re: Good Directive vs Bad Directives
May 02, 2012 03:40AM
Hi Francis, thanks for the response,

Ok, basicly it's just a different directive (simple and 'crowded'
directive), isn't it ? And it doesn't matter with cpu/mem load (such as we
simply could use "try_files" than "if"). So, the conclusion is that "if"
directive is same as "try_files", the different is only on the simplicity,
and it's not causing cpu/mem high load, right?

-----
[[email protected] ~]#
--
View this message in context: http://nginx.2469901.n2.nabble.com/ASK-Good-Directive-vs-Bad-Directives-tp7496293p7518700.html
Sent from the nginx mailing list archive at Nabble.com.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Cliff Wells
Re: Good Directive vs Bad Directives
May 02, 2012 03:50AM
On Tue, 2012-05-01 at 18:34 -0700, antituhan wrote:
> Hi Francis, thanks for the response,
>
> Ok, basicly it's just a different directive (simple and 'crowded'
> directive), isn't it ? And it doesn't matter with cpu/mem load (such as we
> simply could use "try_files" than "if"). So, the conclusion is that "if"
> directive is same as "try_files", the different is only on the simplicity,
> and it's not causing cpu/mem high load, right?

http://wiki.nginx.org/IfIsEvil

Cliff

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Francis Daly
Re: Good Directive vs Bad Directives
May 02, 2012 01:40PM
On Tue, May 01, 2012 at 06:34:57PM -0700, antituhan wrote:

Hi there,

> Ok, basicly it's just a different directive (simple and 'crowded'
> directive), isn't it ?

It's a different directive, that does different things.

> So, the conclusion is that "if"
> directive is same as "try_files", the different is only on the simplicity,
> and it's not causing cpu/mem high load, right?

"if" can do a lot more than try_files, but has its own pitfalls when
used within location{}.

If what you want is "if this file exists, process it; otherwise do this
other thing", that is what try_files is for.

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
antituhan
Re: Good Directive vs Bad Directives
May 03, 2012 03:10PM
Ok thanks francis, got that point :) If "try_files" can do, we don't need
using "if", and if "try_files" can't do, we just insert "if" directive (only
if very needed). Isn't it ?


Francis Daly wrote
>
> On Tue, May 01, 2012 at 06:34:57PM -0700, antituhan wrote:
>
> Hi there,
>
>> Ok, basicly it's just a different directive (simple and 'crowded'
>> directive), isn't it ?
>
> It's a different directive, that does different things.
>
>> So, the conclusion is that "if"
>> directive is same as "try_files", the different is only on the
>> simplicity,
>> and it's not causing cpu/mem high load, right?
>
> "if" can do a lot more than try_files, but has its own pitfalls when
> used within location{}.
>
> If what you want is "if this file exists, process it; otherwise do this
> other thing", that is what try_files is for.
>
> f
> --
> Francis Daly francis@
>
> _______________________________________________
> nginx mailing list
> nginx@
> http://mailman.nginx.org/mailman/listinfo/nginx
>


-----
[[email protected] ~]#
--
View this message in context: http://nginx.2469901.n2.nabble.com/ASK-Good-Directive-vs-Bad-Directives-tp7496293p7523541.html
Sent from the nginx mailing list archive at Nabble.com.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Francis Daly
Re: Good Directive vs Bad Directives
May 04, 2012 12:30AM
On Thu, May 03, 2012 at 06:04:07AM -0700, antituhan wrote:

Hi there,

> Ok thanks francis, got that point :) If "try_files" can do, we don't need
> using "if", and if "try_files" can't do, we just insert "if" directive (only
> if very needed). Isn't it ?

More or less, yes.

Use the right tool for the task. Sometimes try_files is the right one,
sometimes it isn't.

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Sorry, only registered users may post in this forum.

Click here to login