S
S
Stepan2017-03-25 18:32:04
Nginx
Stepan, 2017-03-25 18:32:04

Nginx: how to allow displaying some pages in frames?

Hello.
The question is: is it possible to configure nginx so that it allows displaying only site pages by mask in frames? For example:

example.com/report/xxxxxxxxxxxxxxxxxxx1
example.com/report/xxxxxxxxxxxxxxxxxxx2

can be loaded in frames, but:
example.com/blog/yyyyy
example.com/about

it is forbidden.
Or is it easier not to take a steam bath and immediately allow displaying the entire site in frames?
Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2017-03-25
@xmoonlight

In the "forehead" on js (insert into the template code on each page):

if (window.parent != window.top && window.top.location.href.indexOf('https://example.com/report/')===0) {
  //Мы в iframe-е и адрес основной страницы начинается с "https://example.com/report/"
 //Грузим то, что нужно.
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question