refactor: replace server action with API route for image uploads and update Nginx rate limiting configuration

This commit is contained in:
2026-05-30 01:06:52 +07:00 Unverified
parent bf215bb9cf
commit 96c52e8ad6
4 changed files with 76 additions and 46 deletions
+12 -2
View File
@@ -15,9 +15,19 @@ http {
server {
listen 80;
# Bypass rate limit for static assets and Next.js internal files
location /_next/ {
proxy_pass http://erika:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
# Apply rate limit to actual page loads and API requests
location / {
# Apply rate limit: allow burst of up to 10 requests without delay
limit_req zone=ratelimit burst=10 nodelay;
# Increased burst to 30 to allow normal page loads that fetch multiple APIs/images
limit_req zone=ratelimit burst=30 nodelay;
# Proxy to the Next.js app
proxy_pass http://erika:3000;