Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Example request: http://media1.nguoiduatin.vn/thumb_x680x354/media/bui-the-anh/2017/12/14/tien-le-qua-bot-ql5.jpg
- # /thumb_x680x354 se duoc match theo regular expression
- location /thumb {
- # alias /home/nguoiduatin/media/resize;
- if (!-e $request_filename) {
- rewrite ^/thumb_x([0-9]+)x/(.*)\.(.*) /gen_thumb_xxx.php?path=$2&w=$1&h=0&ex=$3 last;
- rewrite ^/thumb_x([0-9]+)x([0-9]+)/(.*)\.(.*) /gen_thumb_xxx.php?path=$3&w=$1&h=$2&ex=$4 last;
- rewrite ^/thumb_xx([0-9]+)/(.*)\.(.*) /gen_thumb_xxx.php?path=$2&w=0&h=$1&ex=$3 last;
- }
- if (-e $request_filename) {
- expires max;
- add_header Cache-Control public;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement