Created
July 24, 2011 16:09
-
-
Save jiceb/1102773 to your computer and use it in GitHub Desktop.
ngnix.conf - On-Demand Image Creation and Static Delivery with NGINX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# somewhere in the server section of any nginx config | |
# http://www.marceleichner.de/blog/on-demand-image-creation-and-static-delivery-with-nginx/ | |
location ~* \.(png|gif|jpg|jpeg)(\?[0-9]+)?$ { | |
# try existing files, or put request to index.php | |
try_files $uri /thumbnailer.php?image=$uri; | |
# old method when try_files did not exist | |
# if (!-f $request_filename) { | |
# rewrite ^/(.*)$ /thumbnailer.php?image=$1 last; | |
# break; | |
# } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment