feat: increase file upload limit to 10MB for medication images

This commit is contained in:
Daniel Volz
2025-12-20 21:21:49 +01:00
parent 1c9950d29f
commit b96c8db3de
2 changed files with 10 additions and 1 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ await app.register(rateLimit, {
});
await app.register(cookie, { secret: env.COOKIE_SECRET });
await app.register(jwt, { secret: env.JWT_SECRET, cookie: { cookieName: "access_token", signed: false } });
await app.register(fastifyMultipart, { limits: { fileSize: 2 * 1024 * 1024 } }); // 2MB limit
await app.register(fastifyMultipart, { limits: { fileSize: 10 * 1024 * 1024 } }); // 10MB limit
await app.register(fastifyStatic, {
root: imagesDir,
prefix: "/images/",
+9
View File
@@ -5,6 +5,9 @@ server {
root /usr/share/nginx/html;
index index.html;
# Allow larger file uploads (for medication images)
client_max_body_size 10M;
location / {
try_files $uri /index.html;
}
@@ -13,5 +16,11 @@ server {
proxy_pass http://backend:3000/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Timeout for uploads
proxy_read_timeout 60s;
proxy_send_timeout 60s;
}
}