Skip to content

Instantly share code, notes, and snippets.

@ramcq
Created December 19, 2018 21:19
Show Gist options
  • Save ramcq/a3991b5834767c6da73eec1af08b52ab to your computer and use it in GitHub Desktop.
Save ramcq/a3991b5834767c6da73eec1af08b52ab to your computer and use it in GitHub Desktop.
flathub nginx conf.d fragment for ostree repo TTLs
location ~ ^/repo/summary(\.sig)?$ {
root /srv/repo;
expires 1h;
add_header Cache-Control "public";
add_header Surrogate-Control "stale-if-error=86400";
}
location /repo/refs {
root /srv/repo;
expires 1m;
add_header Cache-Control "public";
add_header Surrogate-Control "stale-if-error=86400";
}
location ~ ^/repo/objects/.+\.commitmeta$ {
root /srv/repo;
expires 1d;
access_log off;
add_header Cache-Control "public";
}
location ~ ^/repo/objects/.+\.(sig|sizes2)$ {
return 404;
expires 1y;
access_log off;
add_header Cache-Control "public";
}
location ~ ^/repo/objects/.+\.(commit|dirtree|filez)$ {
root /srv/repo;
expires 1y;
access_log off;
add_header Cache-Control "public";
}
location /repo/deltas {
root /srv/repo;
expires 1y;
access_log off;
add_header Cache-Control "public";
}
location /repo/sources {
root /srv/repo;
expires 1h;
add_header Cache-Control "public";
autoindex on;
}
location /repo/sources/downloads {
root /srv/repo;
expires 1y;
access_log off;
add_header Cache-Control "public";
autoindex on;
}
location /repo {
root /srv/repo;
expires 1h;
add_header Cache-Control "public";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment