<div dir="ltr"><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)"><a href="http://nginx.org/en/docs/http/ngx_http_core_module.html#location" target="_blank">location</a> directive documentation states that '^~' modifier matches prefix locations, not regular expression ones, thus trying to use '^~' with a regular expression will most probably always end up in a failure.<br><br></div><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">Try to use the regular expression case-(in)sensitive modifier.<br></div><div><font size="1"><span style="color:rgb(102,102,102)">---<br></span><b><span style="color:rgb(102,102,102)">B. R.</span></b><span style="color:rgb(102,102,102)"></span></font></div>
<div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 6, 2014 at 3:28 PM, Lorenzo Raffio <span dir="ltr"><<a href="mailto:multiformeingegno@gmail.com" target="_blank">multiformeingegno@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div>
<span><div>location ^~ /categoria/personale-scolastico/area-docenti/ {</div>
<div>                auth_basic                          "Restricted";</div>
<div>                auth_basic_user_file    /var/www/domain/.pswd_docenti;</div>
<div>                try_files $uri $uri/    /index.php?$args;</div>
<div>                include                             /etc/nginx/conf/*.conf;</div>
<div>        }</div>
<div>location ^~ /personale/ {</div>
<div>                auth_basic                          "Restricted";</div>
<div>                auth_basic_user_file    /var/www/domain/.pswd_docenti;</div>
<div>                try_files $uri $uri/    /index.php?$args;</div>
<div>                include                             /etc/nginx/conf/*.conf;</div>
<div>        }</div>
<div><br></div>
<div>location ^~ /colloqui/bs-events {</div>
<div>                auth_basic                          "Restricted";</div>
<div>                auth_basic_user_file    /var/www/domain/.pswd_docenti;</div>
<div>                try_files                           $uri $uri/ /index.php?$args;</div>
<div>                include                             /etc/nginx/conf/*.conf;</div>
<div>        }</div>
<div><br></div>
<div><br></div>
<div><br></div>
<div>Is there a way to combine these locations? The content of the blocks is the same...</div>
<div>I tried with location ^~ (/categoria/personale-scolastico/area-docenti/|/personale/|/colloqui/bs-events) but didn't work..</div></span><div><br></div>
</div>
<br>_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br></blockquote></div><br></div></div>