-
Notifications
You must be signed in to change notification settings - Fork 40
/
nginx.conf.erb
58 lines (46 loc) · 1.63 KB
/
nginx.conf.erb
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
server {
listen 4205;
index index.html;
root /usr/share/nginx/html/;
access_log /var/log/nginx/access.log <%= ENV['NGINX_ACCESS_LOG_DEBUG'] %>;
error_log /var/log/nginx/error.log <%= ENV['NGINX_ERROR_LOG_DEBUG'] %>;
add_header Content-Security-Policy "default-src 'self';";
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
add_header X-Content-Type-Options nosniff;
add_header Cache-Control private;
location ~* \.(?:css|cur|js|jpeg|gif|ico|png|html|xml|svg|json|woff2|woff|ttf)$ {
expires 8h;
add_header Cache-Control public;
}
location /health {
access_log off;
default_type application/json;
return 200 '{"status":"UP"}';
}
location /info {
access_log off;
default_type application/json;
alias /usr/share/nginx/html/info.json;
}
location /tpp/ {
proxy_pass <%= ENV['TPP_REST_SERVER_URL'] %>;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect default;
proxy_http_version 1.1;
}
<% if ENV['CERT_GEN_URL'] && !ENV['CERT_GEN_URL'].empty? %>
location /certgen/ {
proxy_pass <%= ENV['CERT_GEN_URL'] %>/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect default;
}
<% end %>
location / {
proxy_intercept_errors on;
error_page 404 = /index.html;
}
}