forked from Bialogs/SaraAlert
-
Notifications
You must be signed in to change notification settings - Fork 1
/
nginx.conf
executable file
·110 lines (90 loc) · 3.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
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
worker_processes auto;
worker_cpu_affinity auto;
events {
}
http {
server {
root /var/www/saraalert/public;
access_log /var/www/saraalert/log/nginx.access.log;
error_log /var/www/saraalert/log/nginx.error.log;
add_header X-Content-Type-Options nosniff;
location ~ ^/assets/ {
try_files $uri @rails;
access_log off;
gzip_static on;
expires max;
add_header Cache-Control public;
# Some browsers still send conditional-GET requests if there's a
# Last-Modified header or an ETag header even if they haven't
# reached the expiry date sent in the Expires header.
add_header Last-Modified "";
add_header ETag "";
break;
}
}
server {
listen 443 ssl;
listen [::]:443;
server_tokens off;
server_name _;
ssl_certificate /etc/nginx/puma.crt;
ssl_certificate_key /etc/nginx/puma.key;
ssl_session_cache shared:SSL:1m;
ssl_protocols TLSv1.2 TLSv1.3;
if ($request_method !~ ^(GET|POST|PUT|DELETE|OPTIONS|PATCH)$) {
return 405;
}
add_header X-Content-Type-Options nosniff;
location / {
proxy_pass http://sara-alert-enrollment:3000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Host $host;
}
location /report {
proxy_pass http://sara-alert-assessment:3000/;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Host $host;
}
location /r/ {
proxy_pass http://sara-alert-assessment:3000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Host $host;
}
location /fhir {
proxy_pass http://sara-alert-api:3000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Host $host;
}
location /oauth {
proxy_pass http://sara-alert-api:3000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Host $host;
}
}
server {
listen 80;
listen [::]:80;
server_name _;
return 301 https://$host$request_uri;
}
}