-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.conf
95 lines (77 loc) · 2.52 KB
/
app.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
upstream phets_api_node {
server phets-api:4000;
}
upstream phets_file_ms_node {
server phets-file-ms:4007;
}
upstream phets_web_node {
server phets-web:5000;
}
server {
listen 80;
proxy_buffers 64 16k;
proxy_connect_timeout 50s;
client_max_body_size 250M;
proxy_send_timeout 50s;
proxy_read_timeout 50s;
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
location ~ /\. {
deny all;
}
location ~* ^.+\.(rb|log)$ {
deny all;
}
# serve static (compiled) assets directly if they exist (for node production)
location ~ ^/(assets|images|javascripts|stylesheets|swfs|system)/ {
try_files $uri @phets_web_node;
access_log off;
gzip_static on; # to serve pre-gzipped version
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;
}
location /graphql {
try_files $uri $uri/ @phets_api_node ;
}
location /file {
try_files $uri $uri/ @phets_file_ms_node;
}
location /ldap {
try_files $uri $uri/ @phets_ldap_node;
}
location / {
try_files $uri $uri/ @phets_web_node;
}
location @phets_api_node {
proxy_pass http://phets_api_node;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
access_log /var/www/phets/log/nginx.access.log;
error_log /var/www/phets/log/nginx.error.log;
}
location @phets_file_ms_node {
proxy_pass http://phets_file_ms_node;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
access_log /var/www/phets/log/nginx.access.log;
error_log /var/www/phets/log/nginx.error.log;
}
location @phets_web_node {
proxy_pass http://phets_web_node;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
access_log /var/www/phets/log/nginx.access.log;
error_log /var/www/phets/log/nginx.error.log;
}
}