+
95
-

回答

1、nginx.conf配置
http {
limit_conn_zone $binary_remote_addr zone=addr:10m;
}
2、配置nginx_http文件:
server {
  listen 80;
  server_name localhost;
  location / {
    root /data/wwwroot;
    index index.html index.htm;
    try_files $uri $uri/ /index.html;
    add_header Cache-Control no-cache;
    add_header Access-Control-Allow-Origin *;
    limit_conn addr 1; # 每个客户端只允许一个线程
    limit_rate 1024k; # 每个线程最大下载速度1M
  }
}


网友回复

我知道答案,我要回答