Thank you very much. It is working :) On Thu, Nov 3, 2016 at 9:18 PM, Maxim Dounin <mdou...@mdounin.ru> wrote:
> Hello! > > On Thu, Nov 03, 2016 at 02:05:55PM +0800, Tseveendorj Ochirlantuu wrote: > > > Hello, > > > > I need to use geoip module for allow specific region access to my > website. > > But blocked users should see the error_page. Users are blocked and cannot > > see custom error_page. > > > > I don't want to see error_page from other domain. I need to except only > > error page which is not applied to geoip block. > > Try something like this: > > server { > listen 80; > > error_page 403 /403.html; > > location / { > if ($blocked) { > return 403; > } > > ... > } > > location = /403.html { > # no geoip restrictions here > } > } > > With such a configuration GeoIP-based restrictions are only > applied in "location /", but doesn't affect requests to /403.html. > That is, nginx will be able to return the error page correctly. > > -- > Maxim Dounin > http://nginx.org/ > > _______________________________________________ > nginx mailing list > nginx@nginx.org > http://mailman.nginx.org/mailman/listinfo/nginx >
_______________________________________________ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx