-
Notifications
You must be signed in to change notification settings - Fork 4
/
tpl01-baseBreak.mustache
51 lines (41 loc) · 1.22 KB
/
tpl01-baseBreak.mustache
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
#
# Homepage and endpoints of the API "{{title}}".
#
server {
server_name {{host}};
root /var/www/{{host}}/html;
# publishing by default the HTML for API description and related files for navigation
index index.html index.htm;
location / {
try_files $uri $uri/ @proxy;
}
location @proxy {
# # # # # # # # # #
#### special endpoints
{{#each rewrites}}
{{#rewrite_regex}}
rewrite # endpoint "{{../notes}}" for {{../lst}}
{{{../rewrite_regex}}}
{{{../rewrite_url}}}
break;
{{/rewrite_regex}}
{{^rewrite_regex}}
# endpoint {{notes}} for {{lst}}
{{/rewrite_regex}}
{{/each}}
# # # # # # # # # #
#### default and auxiliar endpoint, for all requests of PostgREST-queries
rewrite
^{{basePath}}/(.*)$
/$1
break;
proxy_pass {{proxy_pass}}; # my PostREST is here!
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
default_type {{{produces}}};
proxy_hide_header Content-Location;
proxy_set_header Connection "";
proxy_http_version 1.1;
}
}