Skip to content

Instantly share code, notes, and snippets.

@behringer24
Created January 25, 2012 11:23
Show Gist options
  • Save behringer24/1675873 to your computer and use it in GitHub Desktop.
Save behringer24/1675873 to your computer and use it in GitHub Desktop.
nginx configuration snippet for dynamic image manipulation using HttpImageFilterModule
/*
* nginx configuration snippet for dynamic image manipulation using HttpImageFilterModule
*
* URL example: http://www.yourserver.com/imgresize/250-100-0/demo.jpg
* Parameters are width-height-rotation
* You need to compile nginx with --with-http_image_filter_module
* More information at http://wiki.nginx.org/HttpImageFilterModule
*/
location ~/imgresize/(?P<width>[0-9]+)-(?P<height>[0-9]+)-(?P<rotate>[0-9]+)/(?P<filename>.+)$ {
rewrite /imgresize/[0-9]+-[0-9]+-[0-9]+/(.+)$ /images/$1 break;
image_filter resize $width $height;
image_filter rotate $rotate;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment