K
K
koltykov2014-08-05 09:34:02
Nginx
koltykov, 2014-08-05 09:34:02

NGINX: how to combine all the rules in a location into one?

There is such a config in NGINX:

location ~* ^/admin/(imports|module|libraries|systems)/ {
  deny all;
    }
    location ~* ^/admin/plugins/(gaapi|pdf|php_query)/ {
  deny all;
    }
    location ~* ^/admin/view/templates/ {
  deny all;
    }

How to turn it all into one rule?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor, 2014-08-05
@koltykov

And what prevents you from trying to combine these locales into one through the symbol |. For example like this:

location ~* ^(/admin/(imports|module|libraries|systems)/|/admin/plugins/(gaapi|pdf|php_query)/|/admin/view/templates/) {
    deny all;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question