Nginx + optimize saves
This commit is contained in:
1 parent
2ca7a264b3
commit
b20d5d4a3d
7 files changed
+209
-25
No files matched your search
@@ -0,0 +1,48 @@
|
||||
# Include from the http context, e.g. /etc/nginx/conf.d/vzlet-demo.conf
|
||||
# Public Nginx on the Docker host. Change the hostname and certificate paths.
|
||||
limit_req_zone $binary_remote_addr zone=vzlet_ip:2m rate=8r/s;
|
||||
limit_req_zone $server_name zone=vzlet_site:1m rate=60r/s;
|
||||
limit_conn_zone $binary_remote_addr zone=vzlet_active_ip:2m;
|
||||
limit_conn_zone $server_name zone=vzlet_active_site:1m;
|
||||
|
||||
upstream vzlet_demo {
|
||||
server 127.0.0.1:28080;
|
||||
keepalive 4;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name demo.example.org;
|
||||
ssl_certificate /etc/nginx/tls/vzlet/fullchain.pem;
|
||||
ssl_certificate_key /etc/nginx/tls/vzlet/privkey.pem;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_session_cache shared:vzlet_tls:1m;
|
||||
server_tokens off;
|
||||
|
||||
limit_req zone=vzlet_ip burst=24 nodelay;
|
||||
limit_req zone=vzlet_site burst=48 nodelay;
|
||||
limit_conn vzlet_active_ip 12;
|
||||
limit_conn vzlet_active_site 48;
|
||||
limit_req_status 429;
|
||||
limit_conn_status 429;
|
||||
|
||||
client_header_timeout 10s;
|
||||
client_body_timeout 10s;
|
||||
client_max_body_size 1k;
|
||||
keepalive_timeout 15s;
|
||||
send_timeout 20s;
|
||||
|
||||
location / {
|
||||
if ($request_method !~ ^(GET|HEAD)$) { return 405; }
|
||||
limit_rate 1m;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
proxy_pass_request_headers off;
|
||||
proxy_pass_request_body off;
|
||||
proxy_set_header Content-Length "";
|
||||
proxy_connect_timeout 2s;
|
||||
proxy_read_timeout 30s;
|
||||
proxy_max_temp_file_size 0;
|
||||
proxy_pass http://vzlet_demo;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user