generated from bcgov/bcrs-template-ui
-
Notifications
You must be signed in to change notification settings - Fork 52
/
nginx.conf
81 lines (64 loc) · 2.5 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
# nginx.conf
worker_processes auto;
pid /tmp/nginx.pid;
events {
worker_connections 4096;
}
http {
include /etc/nginx/mime.types;
client_body_temp_path /tmp/client_temp;
proxy_temp_path /tmp/proxy_temp_path;
fastcgi_temp_path /tmp/fastcgi_temp;
uwsgi_temp_path /tmp/uwsgi_temp;
scgi_temp_path /tmp/scgi_temp;
default_type application/octet-stream;
server_tokens off;
underscores_in_headers on;
server {
# Enable HTTP Strict Transport Security (HSTS) to force clients to always
# connect via HTTPS (do not use if only testing)
add_header Strict-Transport-Security "max-age=31536000;";
# Enable cross-site filter (XSS) and tell browser to block detected attacks
add_header X-XSS-Protection "1; mode=block";
# Prevent some browsers from MIME-sniffing a response away from the declared Content-Type
add_header X-Content-Type-Options "nosniff";
# Disallow the site to be rendered within a frame (clickjacking protection)
add_header X-Frame-Options "DENY";
# Turn off all caddy caching
add_header Cache-Control "no-cache,no-store,must-revalidate";
add_header Pragma "no-cache";
# Content Security Policy
add_header Content-Security-Policy "default-src 'self'; frame-src 'self' *.gov.bc.ca *.hotjar.com; script-src 'self' 'unsafe-eval' 'unsafe-inline' *.gov.bc.ca *.hotjar.com *.googleapis.com; style-src 'self' 'unsafe-inline' *.cloudflare.com; font-src 'self' *.gov.bc.ca *.hotjar.com *.cloudflare.com; img-src 'self' *.hotjar.com *.postescanada-canadapost.ca data:; connect-src 'self' *.gov.bc.ca *.launchdarkly.com *.hotjar.com *.postescanada-canadapost.ca *.sentry.io wss://*.hotjar.com *.hotjar.io; manifest-src 'self';";
listen 8080;
server_name _;
index index.html;
error_log /dev/stdout info;
access_log /dev/stdout;
root /app;
location /business {
alias /app;
try_files $uri @index;
gzip on;
gzip_vary on;
gzip_min_length 10240;
gzip_proxied any;
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml;
gzip_disable "MSIE [1-6]\.";
}
location @index {
expires 0;
try_files /index.html =404;
}
# For status of ngnix service, OpenShift is configured to call this
location /nginx_status {
# Enable Nginx stats
stub_status on;
# Only allow access from localhost
allow all;
# Other request should be denied
# deny all;
# No need to log this request, its just noise
access_log off;
}
}
}