mercredi 24 août 2016

nginx if statement string check for domain

I'm trying to check a string if it matches a list of domains;however, I get the following error:

nginx: [emerg] pcre_compile() failed: nothing to repeat in "("*\.duckduckgo\.com|*\.googlebot\.com|*\.crawl\.yahoo\.net|*\.search\.msn\.com|*\.crawl\.baidu.com")" at "*\.googlebot\.com|*\.crawl\.yahoo\.net|*\.search\.msn\.com|*\.crawl\.baidu.com")"

I'm using the following statement:

if ($rdns_hostname ~* (*\.duckduckgo\.com|*\.googlebot\.com|*\.crawl\.yahoo\.net|*\.search\.msn\.com|*\.crawl\.baidu.com)) {
    ...
}

Aucun commentaire:

Enregistrer un commentaire