more robust nginx setup