Comments (3)
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.
from whitenoise.
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.
By default nginx does not serve the .br file and I had to install ngx_brotli and set brotli_static to true to use the br files in the collect_static folder.
Am I doing it all wrong?
server unix:{{app_dir}}/run/gunicorn.sock fail_timeout=0;
}
server {
server_name {{ site_domain }} www.{{ site_domain }} {{ site_domain}};
location /static/ {
alias {{ app_dir }}/collect_static/;
}
location / {
try_files $uri @proxy_to_app;
}
location @proxy_to_app {
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://app_server;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/{{ site_domain }}/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/{{ site_domain }}/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = {{ site_domain }}) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = {{ site_domain }}) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name {{ ip_address }} {{ site_domain }} www.{{ site_domain }} {{ site_domain }};
return 404; # managed by Certbot
}```
from whitenoise.
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.
from whitenoise.
Related Issues (20)
- ModuleNotFoundError: No module named 'whitenoise' HOT 4
- Restrict *.map files HOT 1
- SSL handshake and open() errors after enabling whitenoise HOT 1
- Python 3.11 support? HOT 2
- Should not handle POST, PUT or DELETE HTTP methods? HOT 2
- Can some files be excluded? HOT 1
- Static files not found / bad args passed to finders.find (dev, Windows) HOT 2
- Azure app service web application is throwing 500 internal server error when using whitenoise - CompressedManifestStaticFilesStorage and DEBUG = False HOT 5
- Clarify interaction between WHITENOISE_KEEP_ONLY_HASHED_FILES and WHITENOISE_ROOT HOT 2
- Clarification for using whitenoise with CDN on digital ocean HOT 2
- do not raise exception if sourceMappingURL rereferenced map is missing HOT 1
- whitenoise.storage.MissingFileError HOT 1
- Upgrade to Django 4.2 raises new warning HOT 8
- `render` and `redirect` not working with Django, Gunicorn, and Whitenoise HOT 2
- Merge ASGIWhiteNoise HOT 3
- Django app on Azure: STORAGES (previously STATICFILES_STORAGE) WhiteNoise variable breaks application HOT 1
- Random PostgreSQL connection errors HOT 12
- whitenoise's scantree slows down test suite performance HOT 9
- STORAGES results in Server Error 500 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from whitenoise.