Answer the question
In order to leave comments, you need to log in
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
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 questionAsk a Question
731 491 924 answers to any question