-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathnginx.conf
41 lines (35 loc) · 865 Bytes
/
nginx.conf
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
39
40
41
events {
worker_connections 1500;
}
http {
access_log off;
sendfile on;
error_log /var/log/nginx/error.log;
upstream api {
server api1:8080;
server api2:8080;
keepalive 100;
}
gzip on;
gzip_comp_level 5;
gzip_min_length 256;
gzip_types application/json;
server {
listen 9999 backlog=750;
location / {
proxy_pass http://api;
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;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Adjust buffer sizes for better performance
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
proxy_max_temp_file_size 0;
proxy_temp_file_write_size 256k;
}
}