Tune edge Nginx connection reuse
This commit is contained in:
parent
2f3d1e2a9b
commit
cf6834b264
|
|
@ -10,6 +10,7 @@ proxy_cache_path /var/cache/nginx_dynamic levels=1:2 keys_zone=dynamic_content:5
|
|||
|
||||
upstream homelab_backend {
|
||||
server ${backend_host}:${backend_port};
|
||||
keepalive 16;
|
||||
}
|
||||
|
||||
set_real_ip_from 173.245.48.0/20;
|
||||
|
|
@ -46,12 +47,18 @@ server {
|
|||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
http2 on;
|
||||
server_name ${server_names};
|
||||
|
||||
ssl_certificate /etc/nginx/certs/current.crt;
|
||||
ssl_certificate_key /etc/nginx/certs/current.key;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
ssl_session_cache shared:homelab_ssl:10m;
|
||||
ssl_session_timeout 1d;
|
||||
|
||||
keepalive_timeout 65s;
|
||||
keepalive_requests 1000;
|
||||
|
||||
if ($blocked_uris) { return 403; }
|
||||
|
||||
|
|
@ -102,6 +109,8 @@ server {
|
|||
|
||||
location ~* \.(css|js)$ {
|
||||
proxy_pass http://homelab_backend;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
|
@ -117,6 +126,8 @@ server {
|
|||
|
||||
location ~* \.(jpg|jpeg|png|gif|ico|webp|svg)$ {
|
||||
proxy_pass http://homelab_backend;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
|
@ -134,6 +145,8 @@ server {
|
|||
limit_req zone=one burst=20 nodelay;
|
||||
|
||||
proxy_pass http://homelab_backend;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
|
|
|||
Loading…
Reference in New Issue