Conflicting server name - i don't understand
ktm
nginx-forum at nginx.us
Wed Sep 2 11:37:20 MSD 2009
I think i got it, i misunderstood you Igor, i just created a default vhost with below code, strip down the other vhosts, and put server names for all.Now it's working fine.
(I know it seems I'm talking to myself on nginx forum :), but I don't know where to reply, it seems that mail list response don't appear here)
server {
server_name _;return 444;
## Only allow GET and HEAD request methods
if ($request_method !~ ^(GET|HEAD)$ ) {
return 444;
}
## Deny illegal Host headers
if ($host !~* ^(digitalfav.com|www.digitalfav.com)$ ) {
return 444;
}
## Deny certain User-Agents (case insensitive)
## The ~* makes it case insensitive as opposed to just a ~
if ($http_user_agent ~* (Baiduspider) ) {
return 444;
}
## Deny certain Referers (case insensitive)
## The ~* makes it case insensitive as opposed to just a ~
if ($http_referer ~* (babes|click|diamond|forsale|girl|jewelry|love|nudit|organic|poker|porn|poweroversoftware|sex|teen|video|webcam|zippo) ) {
return 444;
}
## Serve an empty 1x1 gif _OR_ an error 204 for favicon.ico
location = /favicon.ico {
#empty_gif;
return 204;
}
## All other errors get the generic error page
error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417
500 501 502 503 504 505 /error_page.html;
location /error_page.html {
internal;
}
}
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,5464,5468#msg-5468
More information about the nginx
mailing list