nginx filter
2015-06-25 15:35
711 查看
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; }
相关文章推荐
- 提高web性能!nginx和php-fpm分别部署在不同服务器;
- Nginx配置文件nginx.conf中文详解
- Nginx和PHP-FPM的启动、重启、停止脚本
- nginx php解析过慢
- nginx负载均衡配置,宕机自动切换
- nginx location匹配规则
- nginx搭建pathinfo模式支持
- 深入 NGINX: 我们如何设计性能和扩展
- nginx+uwsgi+flask搭建python-web应用程序
- LVS+keeplived+nginx+apache搭建高可用、高性能php集群
- Nginx无法解析php文件
- Nginx 性能调优 Tuning NGINX for Performance
- Nginx Cache中$request_filename(转)
- win7下搭建nginx+php的开发环境(转)
- NGINX引入线程池 性能提升9倍
- mac搭建nginx与php
- Nginx网站服务器的安装及LEMP平台应用
- nginx总结
- mac nginx (48: Address already in use)
- Nginx引入线程池 性能提升9倍