Created
June 26, 2020 20:29
-
-
Save changhuixu/a4065d1fe7bb5b0cf7086f277e21048b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| user nginx; | |
| worker_processes auto; | |
| events { worker_connections 1024; } | |
| http { | |
| include /etc/nginx/proxy.conf; | |
| include /etc/nginx/mime.types; | |
| limit_req_zone $binary_remote_addr zone=one:10m rate=5r/s; | |
| server_tokens off; | |
| sendfile on; | |
| keepalive_timeout 29; # Adjust to the lowest possible value that makes sense for your use case. | |
| client_body_timeout 10; client_header_timeout 10; send_timeout 10; | |
| upstream webapi { | |
| server api:5000; | |
| } | |
| server { | |
| listen 80; | |
| server_name $hostname; | |
| location / { | |
| proxy_pass http://webapi; | |
| limit_req zone=one burst=10 nodelay; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment