Created
July 26, 2013 23:12
-
-
Save EricTendian/6092860 to your computer and use it in GitHub Desktop.
Nginx rewrite config for colored favicons, based on subdomain.
If you have your dev. codebase, staging/qa. codebase, and your prod. codebase on the same server, you can give them different favicons to differentiate between the different branches. All subdomains that start with dev (such as dev.example.com and dev.app.example.com) would get the r…
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
location ~* /favicon(.*) { | |
log_not_found off; | |
access_log off; | |
root /var/www/default; | |
} | |
location = /favicon.ico { | |
if ($host ~* ^dev\.) { | |
rewrite ^/favicon\.ico$ /favicon-red.ico last; | |
} | |
if ($host ~* ^qa\.) { | |
rewrite ^/favicon\.ico$ /favicon-green.ico last; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment