Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not suupport if statements? #20

Open
juxiaoming opened this issue Nov 7, 2023 · 1 comment
Open

not suupport if statements? #20

juxiaoming opened this issue Nov 7, 2023 · 1 comment

Comments

@juxiaoming
Copy link

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

@juxiaoming
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant