Deny all + Custom Error page

basti black.fledermaus at arcor.de
Fri Jun 6 08:57:32 UTC 2014


Here is my solution:

server {
  server_name ~^(.*)\.example\.com$ ;
  return 200;
  deny  all;
  access_log off;
  log_not_found off;
}

 


Am 06.06.2014 09:48, schrieb basti:
> Hello,
>
> I try to block wildcard sub domains as follows:
>
>
> # block wildcard
> server {
>   server_name ~^(.*)\.example\.com$ ;
>   root /usr/share/nginx/www;
>   error_page 403 /index.html;
>   allow 127.0.0.1;
>   deny  all;
>   access_log off;
>   log_not_found off;
> }
>
> I always get the default "403 Forbidden" site of nginx.
> When "deny all" is removed it work as expected.
>
> Can anybody explain?
> And does anybody know a workaround?
>
> Best Regards;
> Basti
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx



More information about the nginx mailing list