scherepanov icon

imgproxy

scherepanov | PRO | 07/05/23 06:47:34 PM UTC | 0 ⭐ | 1104 👁️ | Never ⏰ | []
Bash |

880 B

|

None

|

0 👍

/

0 👎

server {
    listen 80;
    server_name {{ imgproxy_host }};
    location / {
        expires 365d;
 
        set $width "0";
        set $height "0";
        set $type "auto";
        set $enlarge "1";
        set $extend "0";
 
        if ($arg_width) {
            set $width $arg_width;
        }
 
        if ($arg_height) {
            set $height $arg_height;
        }
 
        if ($arg_fit = "bounds") {
            set $type "fit";
            set $extend "1";
        }
 
        if ($arg_fit = "crop") {
            set $type "fill";
            set $extend "1";
        }
 
        set $args '';
 
        rewrite  ^/(.*)$   /insecure/resize:$type:$width:$height:$enlarge:$extend/bg:255:255:255/plain/local:///$1 break;
 
        proxy_pass         http://127.0.0.1:8001;
        proxy_redirect     off;
        proxy_set_header   Host $host;
    }
}
 

Comments