Created
November 15, 2010 19:52
-
-
Save cr0t/700847 to your computer and use it in GitHub Desktop.
Nginx location rewrite rules for some special sort of images. For example, we need to send /var/www/domain/object-images/997/100x74/9979998.jpg file for the query URI like: http://example.com/object-images/997/100x74/9979998/MacBook-Pro-13-inches.jpg
This file contains hidden or 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
location ~ ^.+\.(jpe?g|gif|png)$ { | |
rewrite ^(/object-images)/(\d+)/([0-9x]+)/(\d+)/([a-zA-Z0-9-]+).jpg$ $1/$2/$3/$4.jpg last; | |
try_files $uri /images/empty.png; | |
access_log off; | |
expires 3h; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment