I used to be able to use the OR conditional this way:
location = /(40x|50x).html {
allow all;
}
It looks like I cannot use it anymore in 0.8.53 version. Can you please
let me know what is the new type of compact condition I should use
instead?
Thanks for your help.
On Mon, Dec 06, 2010 at 03:45:02AM -0500, TECK wrote:
Hi all,
I used to be able to use the OR conditional this way:
location = /(40x|50x).html {
allow all;
}
This location should match only requests to “/(40x|50x).html” in
all versions.
It looks like I cannot use it anymore in 0.8.53 version. Can you please
let me know what is the new type of compact condition I should use
instead?
Thanks for your help.
If you want regexp to work you have to mark location as regexp-one
with “~” modifier (and rewrite regexp to be correct), i.e.
location ~ ^/(40x|50x)\.html$ {
allow all;
}
Though I really recommend using two normal (or exact match) locations
instead, i.e.
This is just an example, I have about 20 dirs that needs to be
protected.
Do I have to write each one of them individually in order to preserve
efficiency?
I could create an additional .conf file and include it into
configuration, for sanity reasons.
I just need to know if is best to have the locations separate.
Thanks.
Posted at Nginx Forum:
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.