-
Notifications
You must be signed in to change notification settings - Fork 38
/
nginx.conf
36 lines (31 loc) · 906 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
server {
listen 80;
charset utf-8;
include /etc/nginx/mime.types;
default_type application/octet-stream;
gzip on;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
location ~ ^/(api|admin) {
# /api and /admin routes are handled by the backend
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass $BACKEND_URL;
}
location /static {
# /static files are served without any magic (exact path or 404)
root /srv/www;
try_files $uri =404;
}
location / {
# other routes are served by trying the exact path, and falling back to
# serving the app entrypoint (index.html). this is needed because the
# frontend JS code uses the path component of the URL in its client-side
# routing.
root /srv/www;
try_files $uri $uri/ /index.html;
}
}