nginx-image-filter-watermark
nginx-image-filter-watermark copied to clipboard
not suupport if statements?
Configuration does not support writing in if statements?
./nginx -t : nginx: [emerg] "image_filter_watermark_width_from" directive is not allowed here in /usr/local/nginx/conf/nginx.conf:44 nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
location /images/ { root /usr/local/nginx/html; index index.html index.htm; set $path "/usr/local/nginx/html/water.png";
if ( $arg_download = "download" )
{
# set $nameaa "/usr/local/nginx/html/empty.png";
}
image_filter watermark; #开启水印
image_filter_watermark $path; #水印文件位置 (绝对路径)
image_filter_watermark_position top-left; #水印位置
image_filter_jpeg_quality 95; #图片质量
image_filter_buffer 100M; #缓存
image_filter_watermark_width_from 40 ; # 打水印的图片最小宽度,只有大于这个宽度的才会打水印
image_filter_watermark_height_from 40 ; #打水印的图片最小高度,只有大于这个高度的才会打水印
}
and if $arg_download = "download" ,it will be 415 Unsupported Media Type