微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐