How to add nginx snippet?

I want to remove a header that shouldn’t be transferred to the service. I tried to add snippet like;

nginx.ingress.kubernetes.io/configuration-snippet |
    proxy_set_header Foo-Header 42;

How can I add snippet like this with using ingress yaml or annotations. Thanks.