-
Notifications
You must be signed in to change notification settings - Fork 6
/
nginx.conf
33 lines (29 loc) · 918 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
types {
application/x-bibtex bib;
application/x-research-info-systems ris;
application/xml sch;
text/markdown md;
}
server {
listen 80;
listen [::]:80;
server_name localhost;
client_max_body_size 50M;
location /api/v1 {
# proxy_pass needs the resolver when path includes variable $uri
# https://stackoverflow.com/questions/57937222/502-bad-gateway-nginx-no-resolver-defined-to-resolve
resolver $NGINX_RESOLVER;
# Rewrite URL to avoid 'normalisation' or decoding of the URL path
# see https://stackoverflow.com/questions/28995818/nginx-proxy-pass-and-url-decoding
rewrite ^ $request_uri;
rewrite ^/api/v1/?$ $DRACOR_API_PREFIX break;
rewrite ^/api/v1(/.*) $DRACOR_API_PREFIX$1 break;
return 400;
proxy_pass $DRACOR_API_HOST$uri;
}
location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
}
}