Closed draft1 closed 8 years ago
HTML pages are served with MIME type text/html, which is missing from brotli_types in your config.
But it was stated on your docs that:
Responses with the text/html MIME type are always compressed.
Oh, my bad. Perhaps this issue https://github.com/google/ngx_brotli/issues/22 is relevant?
Almost identical but I don't have full page caching enabled. Even for logged visitors still not showing br encoding for php/html pages.
Sorry, but you didn't provide any useful information.
Could you paste output of:
curl -vso /dev/null -H"Accept-Encoding: gzip, br" http://path/to/your.html
?
And, ideally, the same curl
against your backend server (not NGINX)?
From my desktop: `curl -vso /dev/null -H"Accept-Encoding: gzip, br" https://domain.com/
GET / HTTP/1.1 Host: domain.com User-Agent: curl/7.47.0 Accept: / Accept-Encoding: gzip, br
< HTTP/1.1 200 OK < Server: nginx < Date: Sun, 14 Aug 2016 03:41:06 GMT < Content-Type: text/html; charset=UTF-8 < Transfer-Encoding: chunked < Connection: keep-alive < Expires: Thu, 19 Nov 1981 08:52:00 GMT < Cache-control: private, max-age=0 < Set-Cookie: xf_session=804fdaf5f3d2a16b935656d039576131; path=/; secure; HttpOnly < X-Frame-Options: SAMEORIGIN < Content-Encoding: gzip < Vary: Accept-Encoding < X-Content-Type-Options: nosniff < X-XSS-Protection: 1; mode=block < Strict-Transport-Security: max-age=31536000; includeSubdomains; < { [872 bytes data]
I'm not using any other backend server, just pure Nginx.
From the server itself: `# curl -vso /dev/null -H"Accept-Encoding: gzip, br" https://domain.com/
GET / HTTP/1.1 User-Agent: curl/7.29.0 Host: domain.com Accept: / Accept-Encoding: gzip, br
< HTTP/1.1 200 OK < Server: nginx < Date: Sun, 14 Aug 2016 03:43:51 GMT < Content-Type: text/html; charset=UTF-8 < Transfer-Encoding: chunked < Connection: keep-alive < Expires: Thu, 19 Nov 1981 08:52:00 GMT < Cache-control: private, max-age=0 < Set-Cookie: xf_session=cdbfa6768c8ff303a71e4e2f1a58dccd; path=/; secure; HttpOnly < X-Frame-Options: SAMEORIGIN < Content-Encoding: gzip < Vary: Accept-Encoding < X-Content-Type-Options: nosniff < X-XSS-Protection: 1; mode=block < Strict-Transport-Security: max-age=31536000; includeSubdomains; < { [data not shown]
I'm not using any other backend server, just pure Nginx.
Uhm, there is xf_session
cookie in the response headers, so there is definitely something more than just NGINX...
Anyway, it looks that your backend compresses response with gzip (and NGINX doesn't recompress it with Brotli, by design).
Could you try adding:
proxy_set_header "Accept-Encoding" "";
to your proxy location, so that backend doesn't see Accept-Encoding
header?
https://xenforo.com/help/config-php-options/
enableGzip is set to true by default. Change it to false to have nginx (instead of PHP) handle the compression of text/html responses.
Thanks lot!
Fixed now with this config for XenForo:
$config['enableGzip'] = false;
that's strange my xenforo works with brotli and i didn't need to disable xenforo gzip !
that's strange my xenforo works with brotli and i didn't need to disable xenforo gzip !
Have you tested whether XenForo actually uses gzip? Additionally I think you should disable GZIP there anyway when you compress the files with the webserver as the PHP implementation is quite certainly slower and useless when you use Brotli.
But not working on full html pages.
My config: