In our educational institution, the provider blocks certain sites (something like parental control, but for educational institutions), but instead of showing the stub it redirects to the main page of its site. The management set the task to show the message that the site is blocked, and not just show the provider's site.

I have a local web server on apache + nginx, but I can’t figure out how to intercept 301 redirects to the provider's site and show the page instead?

Simply porting the provider's IP site is not an option, since On this IP, there are still local resources (mail, file sharing) that should work.

Help solve the problem.

  • I correctly understood that the school does not have its own proxy, which stands between the classroom and the provider? - de_frag
  • No, we use NAT on Mikrotik RB2011UAS - Eugene
  • I am not aware of the possibilities of this router, but on a vskidku I would solve the problem as follows: 1. We know that the redirect occurs on the provider side; 2. We need somewhere (on our proxy, router, etc) to determine that a redirect has occurred; 3. Determine the "value" of the redirect - if it is a redirect to the provider's page, then we believe that a redirect occurred due to blocking and we are already making our redirect to our page, ignoring the other redirects. Something like this. - de_frag
  • Well, the problem is how to determine the redirect. I redirect all requests to our local web server and I need to look at where the provider sent ... - Eugene
  • I already have little idea what your “infrastructure” is. I redirect all requests to our local web server - did you make a proxy from a web server? Or how to understand this? - de_frag

0