Regular Expression global redirect

António P. P. Almeida appa at perusio.net
Mon Feb 27 10:13:29 UTC 2012


On 27 Fev 2012 07h33 CET, nginxyz at mail.ru wrote:


> Your solution, while syntactically correct, is wrong by design.
> What you created there is an open anonymizing proxy that will pass
> any request from anyone to any host:port combination that contains
> only the domain name and the TLD, if a functional resolver has been
> set up using the resolver directive. Take a guess what this would
> do:

This deals with illegal Host headers:

server {
    listen 80 default_server;
    server_name _;
    server_name_in_redirect off;
    return 444;
}

--- appa



More information about the nginx mailing list