Skip to content

Instantly share code, notes, and snippets.

@changhuixu
Created June 26, 2020 20:29
Show Gist options
  • Select an option

  • Save changhuixu/a4065d1fe7bb5b0cf7086f277e21048b to your computer and use it in GitHub Desktop.

Select an option

Save changhuixu/a4065d1fe7bb5b0cf7086f277e21048b to your computer and use it in GitHub Desktop.
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