-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnginx.conf
121 lines (96 loc) · 3.45 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
user nobody nogroup;
worker_processes 2;
error_log /dev/stdout;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
accept_mutex on;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /dev/stdout;
# Use the kernel sendfile
# sendfile on; # This causes over-caching because modified timestamps lost in VM
# Prepend HTTP headers before sendfile()
tcp_nopush on;
keepalive_timeout 600;
tcp_nodelay on;
gzip on;
gzip_vary on;
gzip_min_length 500;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
gzip_types text/plain text/xml text/css
text/javascript application/x-javascript
application/javascript application/json;
# Cache static files for a day
map $uri $cacheable {
~\.(?:pn|sv)g$ 1;
~\.js$ 1;
~\.css$ 1;
~\.ico$ 1;
}
map $cacheable $cache_control {
1 "public, max-age=86400";
default "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
}
map $cacheable $expire {
1 1d;
default off;
}
server {
listen 80;
root /var/www/inferno/public;
client_max_body_size 4G;
keepalive_timeout 600;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_redirect off;
# Set expiration based on type of file
add_header Cache-Control $cache_control;
expires $expire;
#####################################
# Redirections
# Inferno platforms have explicit 'Test Kit Pages', which isn't
# yet available default in inferno core, which is completely suite-oriented.
# Redirections to use test kit landing pages instead of suite pages
# This is primarily for when users are in-app and navigate backwards to start new testing sessions
# Inferno platforms are test kit oriented, not suite-oriented
rewrite ^/suites/?$ /test-kits/ redirect;
# Suite landing page -> test-kit landing page mapping
# Be careful to not over-match and take over session URLs; this is just for suite landing pages
rewrite ^/suites/ipa_v\d+/?$ /test-kits/international-patient-access/ redirect;
rewrite ^/suites/us_core_v\d+(_ballot)?/?$ /test-kits/us-core/ redirect;
rewrite ^/suites/au_core_v\d+(_ballot)?/?$ /test-kits/au-core/ redirect;
rewrite ^/suites/au_ps_v\d+(_ballot)?/?$ /test-kits/au-ps/ redirect;
# End redirections
#####################################
#####################################
# Proxy to individual services
location /suites {
proxy_pass http://inferno:4567;
}
location /hl7validatorapi/ {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_redirect off;
proxy_set_header Connection '';
proxy_http_version 1.1;
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 600s;
proxy_pass http://validator-api:3500/;
}
# If you enable the default reference server, uncomment this
# location /reference-server {
# proxy_pass http://inferno_reference_server:8080;
# }
# End Proxy to individual Services
#####################################
}
}