0

Because of legal protection, as a first stage of launching my project I will focus on couple of countries only. The number of supported countries will grow.

I know, it is possible to block or allow whole countries through iptables and geoip. However, on top of this function, I would need to inform the blocked visitor, that the service is not yet supported in his country.

Is there a way, how to redirect a blocked user to a custom webpage, which would inform the visitor?

I use:

  • Ubuntu 14.04 TLS
  • NGINX
  • PHP, HTML5, MySQL, ...

Thank you for your advice. Kind regards,

  • Checking the user's IP address when they initiate a session in the webserver/application (login etc) is another option. – Brian Apr 26 '15 at 0:22
  • @Brian, Hi and thanks for the comment. I know it is possible. I have considered this possibility. However, to save server resources it makes sense to block all the unwanted visitors as early as possible, which means at the Firewall point. Therefore, i would prefer, if there is a way to redirect blocked users to a webpage. – Bunkai.Satori Apr 26 '15 at 7:38
  • In iptables it would be easier to forward their packets to another web server listening on a different port or IP address that just serves the "not available" pages. – Brian Apr 27 '15 at 16:14
  • @Brian, hi and that is really great idea indeed. Do you think, that I can have some second and ultralight webserver hosting this only webpage along with nginx, being the main web server? But you have me realy inspiring idea where to start. – Bunkai.Satori Apr 27 '15 at 16:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.