-
Notifications
You must be signed in to change notification settings - Fork 145
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
Documentation pointer for nginx users #503
Comments
I'm a bit confused by your request. It sounds like you're not using whitenoise in the case that you need to reconfigure nginx to support brotli? Whitenoise does the brotli itself normally. |
Might just me being a dummy :) Ive successfully run collectstatic and the .br files are there so that part works. 👍 Here is my nginx conf for my site which is looking in the collect_static folder for the files. Am I doing it all wrong?
|
To be blunt, yes. Nginx should not have any static file configuration. All requests should be sent through to Django, which serves the static files for you. Try deleting all your static file stuff and it should work, with no nginx brotli support required. |
Python Version
3.9
Django Version
4.1
Package Version
No response
Description
I was working trying to get compression with brotli working to improve a sites performance.
My setup is a digitalocean droplet using gunicorn with nginx proxy.
I incorrectly assumed that the .br files were being served until I looked on the network tab at my css file and
saw that I was not receiving Content-Encoding: br
I set up https://github.com/google/ngx_brotli and changed my nginx config file to serve brotli_static to true and it worked
I think it woulkd be useful to have something in the documentation that says something like if using nginx to serve static files statically you will need to configure it to use brotli
Also I think it would be helpful to add some information about looking at the network tab and checking content-encoding value
I think a lot of users may be using whitenoise like I do but are not getting the benefits of compression
I'll do the work here but want to get a thumbs/thoughts up here before I do
Thanks
Chris
The text was updated successfully, but these errors were encountered: