Created
December 9, 2014 23:10
-
-
Save desheikh/bd1a1d55c8452e9d5537 to your computer and use it in GitHub Desktop.
redirect missing rails digested asset paths in nginx to a non digested version
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 ~* ^\/assets\/(?:.*\/)?([\w-]+)-[0-9a-f]+\.(ico|css|js|gif|jpe?g|png)$ { | |
try_files $uri @missing_image; | |
} | |
location @missing_image { | |
rewrite ^\/assets(.*)-[0-9a-f]+(\.\w+)$ /assets$1$2 permanent; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment