Stratified flow over topography: upstream influence and generation of nonlinear internal waves