Welcome! Log In Create A New Profile

Advanced

replace headers - как?

August 23, 2017 02:31AM
Привет!
Пытаюсь реализовать пункт 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';

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

replace headers - как?

1a2bb2cc August 23, 2017 02:31AM

Re: replace headers - как?

Maxim Dounin August 23, 2017 10:32AM

Re: replace headers - как?

1a2bb2cc August 24, 2017 04:18AM

Re: replace headers - как?

Evgeniy Berdnikov August 24, 2017 04:28AM

Re: replace headers - как?

1a2bb2cc August 24, 2017 04:42AM

Re: replace headers - как?

ALex_hha August 24, 2017 09:44AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 287
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