From 34414f06867bc728727ae7f60f384eb7c11c57e0 Mon Sep 17 00:00:00 2001 From: db1234719 Date: Mon, 17 Nov 2025 23:34:12 +0330 Subject: [PATCH] added the proxy common conf which has everything needed in server blocks of prioxies --- conf.d/proxy-common.conf | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 conf.d/proxy-common.conf diff --git a/conf.d/proxy-common.conf b/conf.d/proxy-common.conf new file mode 100644 index 0000000..30586a9 --- /dev/null +++ b/conf.d/proxy-common.conf @@ -0,0 +1,27 @@ +# Set headers for proxied requests +proxy_set_header Host $host; +proxy_set_header X-Real-IP $remote_addr; +proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +proxy_set_header X-Forwarded-Proto $scheme; + +# WebSocket support +map $http_upgrade $connection_upgrade { + default upgrade; + '' close; +} + +# Proxy buffering +proxy_http_version 1.1; +proxy_set_header Upgrade $http_upgrade; +proxy_set_header Connection $connection_upgrade; +proxy_buffering off; +proxy_cache_bypass $http_upgrade; + +# Timeouts +proxy_connect_timeout 10s; +proxy_send_timeout 60s; +proxy_read_timeout 3600s; # long-lived websocket connections + +# limits +limit_req zone=req_limit burst=10 nodelay; +limit_conn zone=conn_limit 10;