Who told you the ifs are bad practices? They are here to enable Nginx to directly serve static files. By the way in your case, mongrel will be serving static files, and this is really bad!