refactor: replace server action with API route for image uploads and update Nginx rate limiting configuration
This commit is contained in:
+12
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user