Move nginx installation to separate function