-
Notifications
You must be signed in to change notification settings - Fork 16
/
nginx.conf
61 lines (51 loc) · 1.33 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
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# enable gzip compression
gzip on;
gzip_min_length 1100;
gzip_buffers 4 32k;
gzip_types text/plain application/x-javascript text/xml text/css image/svg+xml;
gzip_vary on;
# end gzip configuration
# enable browser caching
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff)$ {
expires 1y;
log_not_found off;
}
# deny direct access to files
location ~ .sqlite$ {
deny all;
}
location ~ .yaml$ {
deny all;
}
location ~ /\.git {
deny all;
}
location /content {
rewrite ^/content/(.*)\.(html|md)$ /error redirect;
}
# end deny configuration
location /cockpit {
try_files $uri $uri/ /cockpit/index.php$is_args$args;
index index.php index.html index.htm;
}
location / {
try_files $uri $uri/ /index.php$is_args$args;
index index.php index.html index.htm;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}