Mercurial Hosting > hghosting
comparison nginx.conf @ 26:d3b72a8bfbe9 default tip
Add rate limiting, change moveLogs.sh to only operate on non-empty files
| author | Violet7 | 
|---|---|
| date | Sat, 01 Nov 2025 22:12:56 -0700 | 
| parents | bbafc54bbd26 | 
| children | 
   comparison
  equal
  deleted
  inserted
  replaced
| 25:8a588847d730 | 26:d3b72a8bfbe9 | 
|---|---|
| 10 sendfile on; | 10 sendfile on; | 
| 11 keepalive_timeout 65; | 11 keepalive_timeout 65; | 
| 12 resolver 8.8.8.8 1.1.1.1 valid=600s; | 12 resolver 8.8.8.8 1.1.1.1 valid=600s; | 
| 13 resolver_timeout 10s; | 13 resolver_timeout 10s; | 
| 14 | 14 | 
| 15 access_log off; | 15 limit_req_zone $binary_remote_addr zone=perip:10m rate=10r/s; | 
| 16 error_log off; | 16 limit_req zone=perip burst=20 nodelay; | 
| 17 limit_req_status 429; | |
| 18 limit_req_log_level warn; | |
| 19 | |
| 20 | |
| 21 | |
| 22 log_format full '$remote_addr - $remote_user [$time_local] ' | |
| 23 '"$request" $status $body_bytes_sent ' | |
| 24 '"$http_referer" "$http_user_agent" ' | |
| 25 'X-Forwarded-For: $http_x_forwarded_for'; | |
| 26 | |
| 27 # Enable access log globally (all requests) | |
| 28 access_log /Users/administrator/hghosting/logs/nginx_access.log full; | |
| 29 error_log /Users/administrator/hghosting/logs/nginx_error.log; | |
| 17 | 30 | 
| 18 server { | 31 server { | 
| 19 listen 80; | 32 listen 80; | 
| 20 include nginx.default.conf; | 33 include nginx.default.conf; | 
| 21 include config/nginx.custom.*.conf; | 34 include config/nginx.custom.*.conf; | 
