| events { |
| worker_connections 8192 |
| } |
|
|
| http { |
| log_format jirack_log '$remote_addr - $remote_user [$time_local] ' |
| '"$request" $status $body_bytes_sent ' |
| '"$http_referer" "$http_user_agent" ' |
| 'rt=$request_time' |
|
|
| access_log /var/log/nginx/access.log jirack_log |
| error_log /var/log/nginx/error.log warn |
|
|
| |
| limit_req_zone $binary_remote_addr zone=jirack_limit:20m rate=30r/m |
|
|
| |
| upstream jirack_backend { |
| least_conn |
| server jirack1:7869 max_fails=3 fail_timeout=10s |
| server jirack2:7869 max_fails=3 fail_timeout=10s |
| server jirack3:7869 max_fails=3 fail_timeout=10s |
| server jirack4:7869 max_fails=3 fail_timeout=10s |
| server jirack5:7869 max_fails=3 fail_timeout=10s |
| } |
|
|
| server { |
| listen 80 |
|
|
| location / { |
| limit_req zone=jirack_limit burst=15 nodelay |
|
|
| proxy_pass http://jirack_backend |
| proxy_http_version 1.1 |
| proxy_set_header Connection "" |
| 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 |
|
|
| proxy_buffering off |
| proxy_request_buffering off |
| proxy_read_timeout 600s |
| proxy_send_timeout 600s |
|
|
| chunked_transfer_encoding on |
| proxy_hide_header X-Powered-By |
| } |
|
|
| |
| location /health { |
| access_log off |
| return 200 "healthy\n" |
| } |
| } |
| } |