X Frame options not allowing my widget to embed(iframe) in other domains/websites

I tried to solve this using the following approach

after_action :allow_iframe

def embed_widget
#my widget code will be here

def allow_iframe
response.headers.delete “X-Frame-Options”


This is working fine in local machine running on thin server.

But not working in production which is running on nginx server

Any one faced this type of problem before ?? Please help me with this problem.


So what headers are being returned by each of those servers?