h5bp / server-configs-apache

Apache HTTP server boilerplate configs
MIT License
3.19k stars 639 forks source link

Pre-compressed rewrite directives without `mod_rewrite` check #291

Closed DanielRuf closed 2 years ago

DanielRuf commented 2 years ago

It looks like there is mod_headers used but it should be probably mod_rewrite:

https://github.com/h5bp/server-configs-apache/blob/2471dd8e1de003a5d3488480468e85c0cdb3647a/h5bp/web_performance/pre-compressed_content_brotli.conf#L20

https://github.com/h5bp/server-configs-apache/blob/2471dd8e1de003a5d3488480468e85c0cdb3647a/h5bp/web_performance/pre-compressed_content_gzip.conf#L19

Original issue / report: https://github.com/h5bp/html5-boilerplate/issues/2633

DanielRuf commented 2 years ago

Very confusing that the Apache docs do not include the mod_rewrite ifmodule checks there.

I guess something like this makes more sense?

<IfModule mod_rewrite.c>
...
    <IfModule mod_headers.c>
    # Force proxies to cache brotlied and non-brotlied files separately
    Header append Vary Accept-Encoding
    </IfModule>
...
</IfModule>
LeoColomb commented 2 years ago

Thanks for opening this case, @DanielRuf. Indeed, looks like an additional check for mod_rewrite might be relevant. Having a failure here is highly unlikely, but for the sake of strictness why not.