-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
34 lines (27 loc) · 1.16 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
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/app/frontend/build;
index index.html;
server_name _;
error_page 502 /502.json;
location /502.json {
return 502 '{"http_code":502,"message":"Bad Gateway (backend down)","meta":{"commit_hash":"nginx","version":"nginx"},"response":{},"status":false}';
}
error_page 503 /503.json;
location /503.json {
return 503 '{"http_code":503,"message":"Service Temporarily Unavailable (too many requests, rate limit)","meta":{"commit_hash":"nginx","version":"nginx"},"response":{},"status":false}';
}
error_page 429 /429.json;
location /429.json {
return 429 '{"http_code":429,"message":"Too many requests. You are being rate limited!","meta":{"commit_hash":"nginx","version":"nginx"},"response":{},"status":false}';
}
location /api {
proxy_pass http://127.0.0.1:5000;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
}