Quantcast
Channel: Nginx Forum - Nginx Mailing List - Russian
Viewing all articles
Browse latest Browse all 3102

replace headers - как? (1 reply)

$
0
0
Привет!
Пытаюсь реализовать пункт 4.2 https://tools.ietf.org/html/rfc2817#section-4 , т.е. добиться вот такого ответа:

1. HTTP/1.1 426 Upgrade Required
2. Server: nginx
3. Date: Wed, 23 Aug 2017 06:05:03 GMT
4. Content-Type: application/octet-stream
5. Content-Length: 16
6. Connection: Upgrade
7. Upgrade: TLS/1.0, HTTP/1.1


Конфигурация вот такая:

server {
listen 0.0.0.0:80;
server_name core.example.com;
add_header Upgrade "TLS/1.0, HTTP/1.1" always;
add_header Connection Upgrade always;
return 426 "Upgrade Required";
}


Смотрю вот так: curl -I http://core.example.com

Но, естественно, получаю вот такой ответ:

1. HTTP/1.1 426
2. Server: nginx
3. Date: Wed, 23 Aug 2017 06:05:03 GMT
4. Content-Type: application/octet-stream
5. Content-Length: 16
6. Connection: keep-alive
7. Connection: Upgrade
8. Upgrade: TLS/1.0, HTTP/1.1

В первой строке отсутствует описание "Upgrade Required" - как сделать чтобы описание добавлялось?
В шестой строке присутствует ненужный "Connection: keep-alive" - как сделать чтобы заголовок Connection перезаписывался, а не суммировался?

З.Ы. Пробовал ещё вот так:

more_clear_headers 'Connection';
more_set_headers 'Connection: Upgrade';

Результат не меняется.

Viewing all articles
Browse latest Browse all 3102

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>