A
A
Alexey Sorokin2015-07-15 13:31:07
Nginx
Alexey Sorokin, 2015-07-15 13:31:07

Negative in nginx locations?

Hi all!
Is it possible in nginx to write location with negation?
I need to make it so that when the URI matches the regular expression: ^/admin(.*)$, there will NOT be a redirect to another domain, and, conversely, it will happen if it is denied.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lynn "Coffee Man", 2015-07-15
@Lynn

You don't need to want it. You need to do this:

server {
  location / {
    # тут редирект
  }
  location /admin {
    # тут админка
  }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question