-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
38 lines (32 loc) · 1.4 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
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
# add_header Content-Security-Policy "default-src 'self'; style-src 'self' 'unsafe-inline' 'unsafe-eval'; script-src 'self' https://www.googletagmanager.com https://ssl.google-analytics.com; img-src 'self' data: https://ssl.google-analytics.com; object-src 'self'; connect-src 'self' http://localhost/";
##
# `gzip` Settings
#
#
gzip on;
# Disable compression for Internet Explorer versions 1-6
gzip_disable "msie6";
# Tells proxies to cache both gzipped and regular versions of a resource
gzip_vary on;
# Compress data even for clients that are connecting via proxies
gzip_proxied any;
# Sets a gzip compression level of a response. Acceptable values are in the range from 1 to 9.
gzip_comp_level 6;
# Sets the number and size of buffers used to compress a response. This is either 4K or 8K, depending on a platform.
gzip_buffers 16 8k;
gzip_http_version 1.1;
# Informs NGINX to not compress anything smaller than the defined size
gzip_min_length 256;
# Enables the types of files that can be compressed
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html =404;
}
}