S
S
Stanislav2018-07-08 13:53:54
Nginx
Stanislav, 2018-07-08 13:53:54

How to allow iframe to be used only for certain domains?

Hello.
The essence of the problem.
About a month ago I began to notice that some sites host my site in an iframe, so I had to cut it down, as tons of external links from homosites began to appear.
I wrote a header to prohibit the use of iframes on third-party sites
add_header X-Frame-Options DENY;
. And then I ran into a problem. There is an iframe application in VK, and you need it to work.
How to be? Is it possible to list the allowed domains?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Sokolov, 2018-07-08
@ms-dred

Try ALLOW-FROM:

add_header X-Frame-Options "ALLOW-FROM https://vk.com/";

_
_ _, 2014-11-08
@AMar4enko

And what do you want to do?
You wrote "If none of the above routes matched, then send to the page /catalog/:categoryId".
I don't see any point in this.
Write redirectTo: '/catalog/1', it will work out the first route with categoryId 1, and if you need to substitute something instead of 1 at the stage of configuring the application, which is transmitted from the server, then you can write JS like this at the template output stage
Connect this module to your application and then you can do

servicesCatalog.config(function ($routeProvider, $compileProvider, INITIAL_CATEGORY_ID) {
//....
            otherwise({
                redirectTo: '/catalog/'+INITIAL_CATEGORY_ID
            });
});

but it smacks of orthopedics

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question