Remove nginx if statements

Try and avoid if statements in Nginx config when possible - http://wiki.nginx.org/IfIsEvil

I haven't tested these changes. It should be along the right path of what to do instead.