G
G
ganzales2019-12-17 17:37:46
Nginx
ganzales, 2019-12-17 17:37:46

Negative in nginx regex?

Help compose a regular expression for location nginx. You need to add a header for all requests that do not end, for example, with .jpg
I try this, but nothing comes out:

location ~ (?!(jpg)$) {
      add_header X-test 123;
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question