location / {
add_header aaa 'aaa value';
#return 200 'second regular match';
#}
}
node1:/etc/nginx#curl 127.0.0.1:2443 -I
HTTP/1.1 200 OK
Server: nginx/1.17.9
Date: Mon, 19 Oct 2020 11:07:25 GMT
Content-Type: text/html
Content-Length: 14
Last-Modified: Wed, 02 Sep 2020 16:00:21 GMT
Connection: keep-alive
ETag: "5f4fc195-e"
aaa: aaa value
Accept-Ranges: bytes
隐藏header:
location / {
proxy_pass http://192.168.137.2:2443;
}
node2:/etc/nginx#curl 192.168.137.3:5443 -I
HTTP/1.1 200 OK
Server: nginx/1.17.9
Date: Thu, 27 Aug 2020 15:43:51 GMT
Content-Type: text/plain
Content-Length: 14
Connection: keep-alive
aaa: aaa value
location / {
proxy_hide_header aaa;
proxy_pass http://192.168.137.2:2443;
}
隐藏header
node2:/etc/nginx#curl 192.168.137.3:5443 -I
HTTP/1.1 200 OK
Server: nginx/1.17.9
Date: Thu, 27 Aug 2020 15:44:28 GMT
Content-Type: text/plain
Content-Length: 14
Connection: keep-alive