-
-
Save JiLiZART/9004795 to your computer and use it in GitHub Desktop.
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
### | |
# Retina images handler | |
### | |
if ($http_cookie ~* "isRetina=1" ) { | |
set $isRetina "retina"; | |
} | |
location ~ ^/bundles/(.*)-retina\.png { | |
try_files /bundles/$1-retina.png @retinaFallback; | |
} | |
location ~ ^/bundles/(.*)\.png$ { | |
if ($isRetina = "retina") { | |
rewrite ^/bundles/(.*).png$ /bundles/$1-retina.png last; | |
} | |
} | |
location @retinaFallback { | |
rewrite ^/bundles/(.*)-retina.png$ /bundles/$1.png break; | |
} | |
## | |
# End retina handler | |
## |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment