Generating images

Instead of writing an image manipulation module for your application, you can configure NGINX to handle some simple transformations. If your image-manipulation needs are as simple as rotating an image, resizing it, or cropping it, NGINX is capable of doing this for you.

To make use of this functionality, you need to have installed the libgd library, and enabled the image_filter module at compile time (--with-http_image_filter_module). If that is the case, you now have use of the directives in the following table:

Image filter directives

Explanation

empty_gif

This directive causes a 1x1 pixel transparent GIF to be emitted for that location directive.

image_filter

This directive transforms an image, according to one of ...

Get Mastering NGINX - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.