Welcome! Log In Create A New Profile

Advanced

Content-Type

Posted by Mihail Dverin 
Content-Type
March 24, 2012 04:39AM
Имеем простейшую конфигурацию проксирования запросов на backend:

server {
location / {
proxy_pass http://x.x.x.x;
}
}

Каким образом можно проверить содержимое header'а "Content-Type" в ответе от backend'а?

Конструкции вида:

server {
location / {
proxy_pass http://x.x.x.x;

if ($content_type = text/plain) {
return 404;
}

if ($upstream_http_content_type = text/plain) {
return 404;
}
}
}

Не работают.
Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 265
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready