-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
52 lines (43 loc) · 1.23 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
events {
worker_connections 4096;
}
http {
# Set the index
index index.html;
include mime.types;
default_type application/octet-stream;
# Make sure client side routing still works
proxy_intercept_errors on;
error_page 404 = /index.html;
# Optimize request data
client_max_body_size 2m;
client_body_buffer_size 128k;
# Set open file cache
open_file_cache max=10000 inactive=5m;
open_file_cache_valid 10m;
open_file_cache_min_uses 1;
open_file_cache_errors on;
# Enable GZip of files GZipped during build.
gzip_static on;
# Enable on-the-fly GZip for files not GZipped on build time.
gzip on;
gzip_buffers 64 8k;
gzip_comp_level 9;
gzip_disable "msie6";
gzip_http_version 1.1;
gzip_types text/plain application/javascript application/json;
# Add a few security headers
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload" always;
add_header Content-Security-Policy "default-src 'self'" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Frame-Options DENY always;
server {
# Create the server
listen 80;
root /usr/share/nginx/html;
# Add cache expiration
expires 3h;
add_header Cache-Control "public";
}
}