feat: manage uploaded image retention
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user