forked from Richie78321/play-rl-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
52 lines (44 loc) · 1.55 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
events {
worker_connections 1024;
}
http {
upstream frontend {
server frontend:80;
}
upstream agent-api {
server agent-api:80;
}
upstream playdata-api {
server playdata-api:80;
}
server {
listen 80;
location / {
proxy_pass http://frontend;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
location /api/agent {
proxy_pass http://agent-api;
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-Prefix /;
# Remove the `/api/agent` prefix.
# `break` ensures that the request is still sent to the backend
# server even though the `/api` prefix has been removed.
rewrite ^/api/agent/(.*)$ /$1 break;
}
location /api/playdata {
proxy_pass http://playdata-api;
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-Prefix /;
# Remove the `/api/playdata` prefix.
# `break` ensures that the request is still sent to the backend
# server even though the `/api` prefix has been removed.
rewrite ^/api/playdata/(.*)$ /$1 break;
}
}
}