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.