-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdefault.conf
35 lines (32 loc) · 1.1 KB
/
default.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
server {
listen 80;
root /home;
access_log logs/access.log;
location ~* "^/(.*)/(.*)\.(jpe?g|png)_(\d+)x(\d+)$"{
set $dir $1;
set $width $4;
set $height $5;
set $dimens "_$4x$5";
set $reImage_name "$2$dimens.$3";
set $image_name "$2.$3";
set $image_uri image_resize/$dir/$image_name?width=$width&height=$height;
alias /home/thumbs/$dir/$reImage_name;
if (!-f $request_filename) {
proxy_pass http://127.0.0.1/$image_uri;
break;
}
proxy_store /home/thumbs/$dir/$reImage_name;
proxy_store_access user:rw group:rw all:r;
proxy_set_header Host $host;
access_log logs/image.access.log;
}
location /image_resize {
access_log logs/image.resize.log;
alias /home;
image_filter resize $arg_width $arg_height;
image_filter_jpeg_quality 75;
image_filter_buffer 10M;
allow 127.0.0.0/8;
deny all;
}
}