-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unit config for .br files delivery instead of .css/.js #91
Comments
Apache 2 config additions from https://www.drupal.org/project/drupal/issues/3184242 + # Serve brotli compressed CSS files if they exist and the client accepts brotli.
+ RewriteCond %{HTTP:Accept-encoding} br
+ RewriteCond %{REQUEST_FILENAME}\.br -s
+ RewriteRule ^(.*css_[a-zA-Z0-9-_]+)\.css$ $1\.css\.br [QSA]
...
+ # Serve brotli compressed JS files if they exist and the client accepts brotli.
+ RewriteCond %{HTTP:Accept-encoding} br
+ RewriteCond %{REQUEST_FILENAME}\.br -s
+ RewriteRule ^(.*js_[a-zA-Z0-9-_]+)\.js$ $1\.js\.br [QSA]
...
+ RewriteRule \.css\.br$ - [T=text/css,E=no-gzip:1,E=no-brotli:1]
+ RewriteRule \.js\.br$ - [T=text/javascript,E=no-gzip:1,E=no-brotli:1]
...
+ <FilesMatch "(\.js\.br\|\.css\.br)$">
+ # Serve correct encoding type.
+ Header set Content-Encoding br
+ # Force proxies to cache compressed & non-compressed css/js files separately.
+ Header append Vary Accept-Encoding
+ </FilesMatch> |
Nginx already has it skilld-labs/skilld-docker-nginx@7d769dd |
We also should add static delivery for |
also it needs to skip logging for images |
Gzip commited df6bfe5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Follow-up to #90
Probably it needs extra
match
rule to test url rewrite for.br
files for js/css assetsDocs https://unit.nginx.org/configuration/#static-files
Refs
The text was updated successfully, but these errors were encountered: