forked from dqualizer/dqanalyzer2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
53 lines (41 loc) · 1.28 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
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
# what times to include
include /etc/nginx/mime.types;
# what is the default one
default_type application/octet-stream;
# Sets the path, format, and configuration for a buffered log write
log_format compression '$remote_addr - $remote_user [$time_local] '
'"$request" $status $upstream_addr '
'"$http_referer" "$http_user_agent"';
server {
# listen on port 80
listen 80;
# save logs here
access_log /var/log/nginx/access.log compression;
gzip on;
# where the root here
root /usr/share/nginx/html;
# what file to server as index
index index.html;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to redirecting to index.html
try_files $uri $uri/ $uri.html /index.html;
}
location ~* \.(?:css|js|jpg|svg)$ {
expires 30d;
add_header Cache-Control "public";
}
location ~* \.(?:json)$ {
expires 1d;
add_header Cache-Control "public";
}
}
}