L
L
luxter2018-09-04 17:27:50
Nginx
luxter, 2018-09-04 17:27:50

What is nginx complaining about?

Good afternoon. There is such a construction, which comes from nginx abusive exhaust:

server {
...
location / {
                if ($http_referer != "demo.company.ru" && $remote_addr != 192.168.88.0/24) {
                return 404;
}
}

nginx: [emerg] invalid condition "$http_referer"
I understand that if is a taboo, but I tried to minimize its use, and yet the error is incomprehensible to me. I would be grateful for a hint.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Danila Vershinin, 2018-09-04
@luxter

nginx complains &&because logical and and or are not supported in the if.
This is just one of the many reasons why mapyou just have to use :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question