nginx filter
2024-08-29 17:16:09
server
{
listen 80;
server_name g.zcdn.com;
index index.html; location / {
proxy_cache cache_go;
proxy_temp_path /dev/shm/tmp 1 1 2;
proxy_cache_valid 200 302 8h;
proxy_cache_valid 404 415 1m;
proxy_cache_valid any 10m;
proxy_cache_key $host$uri$is_args$args; proxy_set_header Host $host;
proxy_pass http://localhost:18001;
} location ~* .*_(\d+)x(\d+)_(\d+)\.(JPG|jpg|gif|png|PNG)$ {
set $img_width $1;
set $img_height $2;
set $img_quality $3;
rewrite ^(.*)_\d+x\d+_\d+.(JPG|jpg|gif|png|PNG)$ $1.$2 break;
image_filter resize $img_width $img_height;
image_filter_buffer 10M;
image_filter_jpeg_quality $img_quality; proxy_cache cache_go;
proxy_temp_path /dev/shm/tmp 1 1 2;
proxy_cache_valid 200 302 8h;
proxy_cache_valid 404 415 1m;
proxy_cache_valid any 10m;
proxy_cache_key $host$uri$is_args$args; proxy_pass http://localhost:18001;
#error_page 415 = /empty;
expires 10d;
} location ~* .*_(\d+)x(\d+)_(\d+)a(90|180|270)\.(JPG|jpg|gif|png|PNG)$ {
set $img_width $1;
set $img_height $2;
set $img_quality $3;
set $img_angle $4;
rewrite ^(.*)_\d+x\d+_\d+a\d+\.(JPG|jpg|gif|png|PNG)$ $1.$2 break;
image_filter resize $img_width $img_height;
image_filter rotate $img_angle;
image_filter_buffer 10M;
image_filter_jpeg_quality $img_quality; proxy_cache cache_go;
proxy_temp_path /dev/shm/tmp 1 1 2;
proxy_cache_valid 200 302 8h;
proxy_cache_valid 404 415 1m;
proxy_cache_valid any 10m;
proxy_cache_key $host$uri$is_args$args; proxy_pass http://localhost:18001;
#error_page 415 = /empty;
expires 10d;
} location ~* .*_r(90|180|270)\.(JPG|jpg|gif|png|PNG)$ {
set $angle $1;
rewrite ^(.*)_r(90|180|270)\.(JPG|jpg|gif|png|PNG)$ $1.$3 break;
image_filter rotate $angle;
image_filter_buffer 10M; proxy_cache cache_go;
proxy_temp_path /dev/shm/tmp 1 1 2;
proxy_cache_valid 200 302 8h;
proxy_cache_valid 404 415 1m;
proxy_cache_valid any 10m;
proxy_cache_key $host$uri$is_args$args; proxy_pass http://localhost:18001;
#error_page 415 = /empty;
expires 10d; } access_log /apps/logs/nginx/g.zcdn.com.log log_access;
}
最新文章
- [转]SQL Server 存储过程 一些常用用法(事物、异常捕捉、循环)
- 编译安装的 mysql apache 用 service mysqld start 来启动
- 《C++ primer》--第12章
- Java多态的体现之接口
- WordPress Think Responsive Themes ‘upload_settings_image.php’任意文件上传漏洞
- web_reg_find()查询信息为变量
- 【转】android去掉EditView的默认焦点问题
- 使用 PIVOT 和 UNPIVOT 行转列 列转行 报表统计 函数
- ES5 object的新函数
- Uber上海公司被司机打上门
- [Linked List]Remove Linked List Elements
- [译]ASP.NET Core 2.0 部分视图
- [网络流]BZOJ4657 最小割约束
- python之正则表达式和re模块一
- CentOS挂载光盘
- Ajax-创建ajax
- JS在严格模式和非严格模式的区别
- [BZOJ2216]Lightning Conductor
- VS2012 Getting Started with Owin and Katana
- leetcode 【 Remove Nth Node From End of List 】 python 实现