feat: add Redis caching for follower counts, implement fetch timeouts, enable Nginx gzip compression, and refactor icon management.
This commit is contained in:
+29
-3
@@ -9,15 +9,41 @@ http {
|
||||
error_log /dev/stderr warn;
|
||||
access_log /dev/stdout;
|
||||
|
||||
# Gzip compression
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_proxied any;
|
||||
gzip_comp_level 6;
|
||||
gzip_min_length 256;
|
||||
gzip_types
|
||||
text/plain
|
||||
text/css
|
||||
text/xml
|
||||
text/javascript
|
||||
application/javascript
|
||||
application/json
|
||||
application/xml
|
||||
application/rss+xml
|
||||
image/svg+xml;
|
||||
|
||||
# Define rate limit zone: 10MB memory, 5 requests per second per IP
|
||||
limit_req_zone $binary_remote_addr zone=ratelimit:10m rate=5r/s;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen 8606;
|
||||
|
||||
# Bypass rate limit for static assets and Next.js internal files
|
||||
location /_next/static/ {
|
||||
proxy_pass http://127.0.0.1:3000;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
|
||||
# Cache static assets for 1 year (they have hashed filenames)
|
||||
add_header Cache-Control "public, max-age=31536000, immutable";
|
||||
}
|
||||
|
||||
location /_next/ {
|
||||
proxy_pass http://erika:3000;
|
||||
proxy_pass http://127.0.0.1:3000;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
@@ -30,7 +56,7 @@ http {
|
||||
limit_req zone=ratelimit burst=30 nodelay;
|
||||
|
||||
# Proxy to the Next.js app
|
||||
proxy_pass http://erika:3000;
|
||||
proxy_pass http://127.0.0.1:3000;
|
||||
|
||||
# Next.js often requires HTTP/1.1
|
||||
proxy_http_version 1.1;
|
||||
|
||||
Reference in New Issue
Block a user