feat: store editor images in upload bind

This commit is contained in:
2026-08-06 15:52:54 +00:00
parent 9046a131f2
commit dc0e1a6da9
8 changed files with 91 additions and 27 deletions
+18 -5
View File
@@ -69,9 +69,9 @@ http {
proxy_request_buffering on;
}
location ^~ /v1/uploads/user-icons/ {
location ^~ /v1/uploads/ {
limit_except PUT { deny all; }
client_max_body_size 50k;
client_max_body_size 1m;
proxy_pass http://image-hook:8081;
proxy_set_header Host $host;
proxy_set_header X-Image-Client $http_x_image_client;
@@ -92,8 +92,8 @@ http {
add_header X-Content-Type-Options nosniff always;
}
location ^~ /icons/users/ {
alias /srv/user-icons/;
location ~ "^/icons/users/([a-z0-9][a-z0-9_-]{1,31})/([a-f0-9]{32}\.(?:avif|webp|jpe?g|png|gif))$" {
alias /srv/uploads/user-icons/$1/$2;
etag on;
expires 1y;
add_header Cache-Control "public, immutable" always;
@@ -101,7 +101,20 @@ http {
add_header X-Content-Type-Options nosniff always;
}
location ^~ /icons/ {
location /icons/users/ { return 404; }
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;
etag on;
expires 1y;
add_header Cache-Control "public, immutable" always;
add_header Access-Control-Allow-Origin "*" always;
add_header X-Content-Type-Options nosniff always;
}
location /uploads/ { return 404; }
location /icons/ {
try_files $uri =404;
add_header Access-Control-Allow-Origin "*" always;
add_header X-Content-Type-Options nosniff always;