-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproxy_params.conf
More file actions
38 lines (30 loc) · 1.08 KB
/
proxy_params.conf
File metadata and controls
38 lines (30 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Common proxy parameters for Node.js backend
# Include this file in location blocks: include /etc/nginx/conf.d/proxy_params.conf;
# Proxy protocol and connection settings
proxy_http_version 1.1;
proxy_set_header Connection "";
# Preserve original request information
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;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
# For Kubernetes/Docker environments
proxy_set_header X-Original-URI $request_uri;
proxy_set_header X-Request-ID $request_id;
# Disable proxy buffering for real-time responses (SSE, streaming)
# Uncomment if needed for your use case
# proxy_buffering off;
# Standard proxy buffering settings
proxy_buffer_size 4k;
proxy_buffers 8 4k;
proxy_busy_buffers_size 8k;
# Timeouts
proxy_connect_timeout 60s;
proxy_send_timeout 60s;
proxy_read_timeout 60s;
# Disable redirects rewriting
proxy_redirect off;
# Pass through client request body
proxy_request_buffering on;