This commit is contained in:
728
2022-12-03 13:34:28 +08:00
parent 757a0f24cf
commit db772ace74
2 changed files with 23 additions and 10 deletions

View File

@ -27,12 +27,18 @@ http {
server_tokens off; server_tokens off;
charset utf-8; charset utf-8;
map $server_protocol $h1_addr {
default "";
"HTTP/1.0" $binary_remote_addr;
"HTTP/1.1" $binary_remote_addr;
}
limit_conn_status 444; limit_conn_status 444;
limit_conn_zone $binary_remote_addr zone=addr_conn:10m; limit_conn_zone $binary_remote_addr zone=addr_conn:10m;
limit_conn_zone $binary_remote_addr zone=h1_conn:10m; limit_conn_zone $h1_addr zone=h1_conn:10m;
limit_req_status 444; limit_req_status 444;
limit_req_zone $binary_remote_addr zone=addr_req:10m rate=100r/s; limit_req_zone $binary_remote_addr zone=addr_req:10m rate=100r/s;
limit_req_zone $binary_remote_addr zone=h1_req:10m rate=10r/m; limit_req_zone $h1_addr zone=h1_req:10m rate=10r/m;
types { types {
text/html html; text/html html;
@ -52,12 +58,12 @@ http {
listen 80; listen 80;
server_name ismist.cn localhost; server_name ismist.cn localhost;
limit_conn h1_conn 10;
limit_req zone=h1_req burst=5 nodelay;
limit_conn addr_conn 100; limit_conn addr_conn 100;
limit_req zone=addr_req burst=20 nodelay; limit_req zone=addr_req burst=20 nodelay;
limit_conn h1_conn 5;
limit_req zone=h1_req burst=10 nodelay;
root ui; root ui;
location = / { location = / {

View File

@ -27,12 +27,21 @@ http {
server_tokens off; server_tokens off;
charset utf-8; charset utf-8;
map $server_protocol $h1_addr {
default "";
"HTTP/1.0" $binary_remote_addr;
"HTTP/1.1" $binary_remote_addr;
}
limit_conn_status 444; limit_conn_status 444;
limit_conn_zone $binary_remote_addr zone=addr_conn:10m; limit_conn_zone $binary_remote_addr zone=addr_conn:10m;
limit_conn_zone $binary_remote_addr zone=h1_conn:10m; limit_conn_zone $h1_addr zone=h1_conn:10m;
limit_req_status 444; limit_req_status 444;
limit_req_zone $binary_remote_addr zone=addr_req:10m rate=100r/s; limit_req_zone $binary_remote_addr zone=addr_req:10m rate=100r/s;
limit_req_zone $binary_remote_addr zone=h1_req:10m rate=10r/m; limit_req_zone $h1_addr zone=h1_req:10m rate=10r/m;
limit_conn h1_conn 10;
limit_req zone=h1_req burst=5 nodelay;
types { types {
text/html html; text/html html;
@ -51,10 +60,8 @@ http {
server { server {
listen 80; listen 80;
listen [::]:80; listen [::]:80;
server_name ismist.cn;
limit_conn h1_conn 5; server_name ismist.cn;
limit_req zone=h1_req burst=10 nodelay;
location / { location / {
return 301 https://$host$request_uri; return 301 https://$host$request_uri;