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

13 views
Skip to first unread message

manojchowdary27

unread,
Sep 2, 2017, 10:20:45 AM9/2/17
to Ruby on Rails: Talk
I tried to solve this using the following approach

after_action :allow_iframe

def embed_widget
#my widget code will be here
end

private
def allow_iframe 
  response.headers.delete "X-Frame-Options"
end

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.
Thanks.

Hassan Schroeder

unread,
Sep 2, 2017, 11:52:40 AM9/2/17
to rubyonrails-talk
On Sat, Sep 2, 2017 at 3:17 AM, manojchowdary27 <manoj2...@gmail.com> wrote:

> This is working fine in local machine running on thin server.
> But not working in production which is running on nginx server

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

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote
Reply all
Reply to author
Forward
0 new messages