-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx.conf
80 lines (62 loc) · 2.26 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
worker_processes 1;
events { worker_connections 1024; }
error_log logs/error.log notice;
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
brotli on;
brotli_static on;
brotli_comp_level 11;
brotli_types text/plain text/css application/json application/javascript application/x-javascript text/javascript text/xml application/xml application/rss+xml application/atom+xml application/rdf+xml;
# output compression saves bandwidth
gzip on;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/javascript text/xml application/xml application/rss+xml application/atom+xml application/rdf+xml;
# make sure gzip does not lose large gzipped js or css files
# see http://blog.leetsoft.com/2007/07/25/nginx-gzip-ssl.html
gzip_buffers 16 8k;
# Disable gzip for certain browsers.
gzip_disable “MSIE [1-6].(?!.*SV1)”;
server {
listen 3001;
server_name localhost;
location / {
root data/www;
index index.html index.htm;
}
}
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name localhost;
ssl_certificate ssl/nginx-selfsigned.crt;
ssl_certificate_key ssl/nginx-selfsigned.key;
location / {
root data/www;
index index.html index.htm;
proxy_cache_revalidate on;
expires 1;
}
#js
# location ~* ^/scripts/$ {
# add_header Cache-Control must-revalidate; # Indicate that the resource may be cached by public caches like web caches for instance, if set to 'private' the resource may only be cached by client's browser.
# expires 1;
# etag on;
# }
# # CSS
# location ~* ^/css/$ {
# add_header Cache-Control public;
# # Equivalent to above:
# expires 86400; # Indicate that the resource can be cached for 86400 seconds (24 hours)
# etag on; # Add an ETag header with an identifier that can be stored by the client
# }
# # Images
# location ~* ^/img/$ {
# add_header Cache-Control must-revalidate; # Indicate that the resource must be revalidated at each access
# etag on;
# }
}
}