-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsprout.conf
70 lines (58 loc) · 1.76 KB
/
sprout.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
#
# Sprout v3.2 + v4 nginx config
#
client_max_body_size 25m;
location @sprout {
try_files $uri /index.php?kohana_uri=$uri&$args;
}
# Serve static files and dirs, or Sprout URLs
location / {
try_files $uri $uri/ @sprout;
}
# Serve media repo files statically
location ^~ /files {
expires 48h;
access_log off;
log_not_found off;
}
# Serve resizes directly from the cache, if present
location ~* /file/resize/(.+)$ {
expires 48h;
access_log off;
log_not_found off;
try_files /files/resize/$1 @sprout;
}
# Asset rewrites
location ~* ^/(media|sprout|modules|skin) {
access_log off;
log_not_found off;
# Media with timestamps
rewrite ^/media-[0-9]+/(.+)$ /_media/$1;
rewrite ^/skin-[0-9]+/(.+)$ /_media/skin/$1;
# Backwards compatibility
rewrite ^/media/(.+)$ /_media/core/$1;
rewrite ^/sprout/media/(.+)$ /_media/sprout/$1;
rewrite ^/modules/(.+)/media/(.+)$ /_media/$1/$2;
rewrite ^/skin/(.+)$ /_media/skin/$1;
}
# This block will catch static file requests, such as css and js
# But not if processed first by the compat rewrites first.
location ~* \.(?:ico|css|js)$ {
expires 48h;
access_log off;
log_not_found off;
try_files $uri @sprout;
}
# A few things to not bother logging
location = /robots.txt {
access_log off;
log_not_found off;
try_files $uri @sprout;
}
location = /favicon.ico { access_log off; log_not_found off; }
# A few blocked things
location ~ /\. { access_log off; log_not_found off; deny all; }
location ~* \.sh$ { access_log off; log_not_found off; deny all; }
location ~* \.svn$ { access_log on; log_not_found off; deny all; }
location ~* \.git$ { access_log on; log_not_found off; deny all; }
location ~* \.env$ { access_log on; log_not_found off; deny all; }