-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
63 lines (49 loc) · 1.33 KB
/
Copy pathnginx.conf
File metadata and controls
63 lines (49 loc) · 1.33 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
worker_processes 5; ## Default: 1
pid /var/run/nginx.pid;
error_log /var/log/nginx/error.log debug;
events {
worker_connections 4096; ## Default: 1024
}
http {
charset utf-8;
more_set_headers 'Server: parcorpus';
log_format main '$http_x_forwarded_for - $remote_user [$time_local] "$host" "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $request_time';
map $http_connection $connection_upgrade {
"~*Upgrade" $http_connection;
default keep-alive;
}
upstream get_pbackend {
server backend-main:80 weight=2;
server backend-read-only-1:80 weight=1;
server backend-read-only-2:80 weight=1;
}
upstream pbackend {
server backend-main:80;
}
upstream frontend {
server frontend:5173;
}
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;
include servers/*;
server {
location ^~ /api/v1/ {
if ($request_method != GET) {
proxy_pass http://pbackend;
}
if ($request_method = GET) {
proxy_pass http://get_pbackend;
}
}
location ~ / {
proxy_pass http://frontend;
}
location /status {
stub_status;
}
}
}