nginx启用brotli压缩算法
作者:互联网
nginx启用brotli压缩算法配置:
brotli on; brotli_comp_level 6; brotli_types text/xml text/plain text/css application/javascript application/x-javascript application/rss+xml application/atom+xml application/xml application/json; |
在server{}中启用该配置进行测试
curl --header "Accept-Encoding: gzip, deflate, br" -kv htpps://127.0.0.1:443。
curl --header "Accept-Encoding: gzip, deflate, br" -kv https://127.0.0.1:443 * About to connect() to 127.0.0.1 port 443 (#0) * Trying 127.0.0.1... connected * Connected to 127.0.0.1 (127.0.0.1) port 443 (#0) * successfully set certificate verify locations: * CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none * SSLv3, TLS handshake, Client hello (1): * SSLv3, TLS handshake, Server hello (2): * SSLv3, TLS handshake, CERT (11): * SSLv3, TLS handshake, Server key exchange (12): * SSLv3, TLS handshake, Server finished (14): * SSLv3, TLS handshake, Client key exchange (16): * SSLv3, TLS change cipher, Client hello (1): * SSLv3, TLS handshake, Finished (20): * SSLv3, TLS change cipher, Client hello (1): * SSLv3, TLS handshake, Finished (20): * SSL connection using ECDHE-RSA-AES128-GCM-SHA256 * Server certificate: * subject: C=CN; ST=Beijing; L=Beijing; O=xxx; OU=xxx; CN=xxx.com * start date: 2019-12-25 09:05:06 GMT * expire date: 2022-1-25 09:05:06 GMT * common name: xxx.xxx.com (does not match '127.0.0.1') * issuer: C=CN; ST=Beijing; L=Beijing; O=xxx; OU=xxx; CN=xxx.com * SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway. > GET / HTTP/1.1 > User-Agent: curl/1.0 (curl 7.19.7) (x86_64-unknown-linux-gnu) libcurl/7.19.7 OpenSSL/1.0.1e zlib/1.2.3 > Host: 127.0.0.1:443 > Accept: */* > Accept-Encoding: gzip, deflate, br > < HTTP/1.1 200 OK < Server: OLWAF 1.0.0 < Date: Wed, 20 Nov 2020 10:13:17 GMT < Content-Type: text/plain < Transfer-Encoding: chunked < Connection: close < Vary: Accept-Encoding < Content-Encoding: br < x-lb-timing: 0.000 < x-idc-id: 2 |
response响应Content-Encoding头为br。
标签:TLS,handshake,127.0,0.1,xxx,brotli,nginx,SSLv3,压缩算法 来源: https://blog.csdn.net/realmardrid/article/details/117457212