Skip to content
Snippets Groups Projects

aurweb: serve assets from nginx and cache properly

Merged Jelle van der Waa requested to merge ngnix_serve_assets into master
1 file
+ 8
0
Compare changes
  • Side-by-side
  • Inline
  • Make nginx serve static assets to offload gunicorn as for example
    loading the home page is making 7 static requests out of 8 requests in
    total. Set caching headers for now for 7 days, so browsers don't request
    ideally this would be 30 days but let's keep it 7 days for now.
@@ -71,6 +71,14 @@ server {
expires 5m;
}
location ~ ^/static/(?:css|js|images)/ {
rewrite ^/static(/.*)$ $1 break;
expires 7d;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
location / {
# Proxy over to aurweb's ASGI application.
proxy_pass http://{{ aurweb_asgi_bind }};
Loading