Skip to content
Snippets Groups Projects
Commit 3399e17d authored by Jelle van der Waa's avatar Jelle van der Waa :construction: Committed by Jelle van der Waa
Browse files

aurweb: serve assets from nginx and cache properly

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.
parent 3430e875
No related branches found
No related tags found
1 merge request!538aurweb: serve assets from nginx and cache properly
Pipeline #16135 passed
......@@ -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 }};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment