feat: manage uploaded image retention

This commit is contained in:
2026-08-07 07:14:14 +00:00
parent dc0e1a6da9
commit a935b23571
13 changed files with 966 additions and 23 deletions
@@ -82,6 +82,32 @@ http {
}
location ^~ /v1/admin/ { return 404; }
location = /admin {
proxy_pass http://image-hook:8081/admin;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location ^~ /admin/ {
client_max_body_size 8k;
proxy_pass http://image-hook:8081;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_request_buffering on;
}
location = /v1/internal/content-access {
internal;
proxy_pass http://image-hook:8081/v1/internal/content-access;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header X-Image-Path $request_uri;
access_log off;
}
location = /image { return 404; }
location = /image/ { return 404; }
location ^~ /image/ { rewrite ^/image/(.*)$ /$1 last; }
@@ -105,6 +131,8 @@ http {
location ~ "^/uploads/([a-z0-9][a-z0-9_-]{1,31})/([a-f0-9]{32}\.(?:avif|webp|jpe?g|png|gif))$" {
alias /srv/uploads/content/$1/$2;
mirror /v1/internal/content-access;
mirror_request_body off;
etag on;
expires 1y;
add_header Cache-Control "public, immutable" always;