Combine location blocks with same content

Lorenzo Raffio multiformeingegno at gmail.com
Mon Oct 6 13:28:06 UTC 2014


location ^~ /categoria/personale-scolastico/area-docenti/ {
                auth_basic                          "Restricted";
                auth_basic_user_file    /var/www/domain/.pswd_docenti;
                try_files $uri $uri/    /index.php?$args;
                include                             /etc/nginx/conf/*.conf;
        }
location ^~ /personale/ {
                auth_basic                          "Restricted";
                auth_basic_user_file    /var/www/domain/.pswd_docenti;
                try_files $uri $uri/    /index.php?$args;
                include                             /etc/nginx/conf/*.conf;
        }


location ^~ /colloqui/bs-events {
                auth_basic                          "Restricted";
                auth_basic_user_file    /var/www/domain/.pswd_docenti;
                try_files                           $uri $uri/ /index.php?$args;
                include                             /etc/nginx/conf/*.conf;
        }






Is there a way to combine these locations? The content of the blocks is the same...
I tried with location ^~ (/categoria/personale-scolastico/area-docenti/|/personale/|/colloqui/bs-events) but didn't work..
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20141006/0a26f6f3/attachment.html>


More information about the nginx mailing list