Welcome! Log In Create A New Profile

Advanced

Re: Deny all + Custom Error page

basti
June 06, 2014 04:58AM
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@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Deny all + Custom Error page

basti June 06, 2014 03:50AM

Re: Deny all + Custom Error page

basti June 06, 2014 04:58AM

Re: Deny all + Custom Error page

Jonathan Matthews June 06, 2014 05:26AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 268
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready