forked from getodk/central-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
74 lines (60 loc) · 2.1 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Copyright 2017 ODK Central Developers
# See the NOTICE file at the top-level directory of this distribution and at
# https://github.com/getodk/central-frontend/blob/master/NOTICE.
#
# This file is part of ODK Central. It is subject to the license terms in
# the LICENSE file found in the top-level directory of this distribution and at
# https://www.apache.org/licenses/LICENSE-2.0. No part of ODK Central,
# including this file, may be copied, modified, propagated, or distributed
# except according to the terms contained in the LICENSE file.
# This configuration file is for development only. For production, see
# https://github.com/getodk/central.
#
# One difference between this file and the configuration for production is that
# this configuration does not support request body decompression.
events {
}
http {
# This path may be different on your local computer depending on your OS and
# how you installed nginx.
include /usr/local/etc/nginx/mime.types;
map $sent_http_set_cookie $session_cookie {
~^__Host-(session=.+)$ $1;
}
server {
listen 8989;
server_name localhost;
server_tokens off;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options nosniff;
client_max_body_size 100m;
gzip on;
gzip_vary on;
gzip_min_length 1280;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml text/csv;
location /- {
proxy_pass http://localhost:8005/-;
proxy_redirect off;
proxy_set_header Host $host;
}
location ~ ^/v\d {
proxy_pass http://localhost:8383;
proxy_redirect off;
add_header Set-Cookie $session_cookie;
proxy_set_header X-Forwarded-Proto https;
# buffer requests, but not responses, so streaming out works.
proxy_request_buffering on;
proxy_buffering off;
proxy_read_timeout 2m;
}
location / {
# Specify the dist/ directory of the repository to `nginx -p` so that . is
# relative to dist/.
root .;
location /index.html {
add_header Cache-Control no-cache;
}
}
}
}