Unable to modify headers in nginx

I recently got introduced to nginx, and I'm pretty much a beginner in it. I was trying to do this example in which I try to run nginx as a reverse proxy, request a page, say "http://example.com" and then hide one of the headers returned by that page.

here's the config file I'm using:

server {
    listen 80;
    location / {
        proxy_pass "http://example.com"
        proxy_hide_header SOMEHEADER
    }
}

I was able to redirect / to http://example.com, but I am not able to hide the header. I have also tried modifying the value of that header, but that didn't work too. What I noticed was that every time I requested / and the page got redirected the header was sent again with the response page.

I have a small web app that I've developed some while ago, and now I want to use it an iframe for some new integrations. I am trying to get over the X-Frame-Options value, but I am not able to do that.

I am using nginx 1.4.6 on an Ubuntu 16.04 machine.