Nginx rule for subdomains: ERR_TOO_MANY_REDIRECTS

Igal @ igal at
Wed Jun 7 22:25:47 UTC 2017

On 5/31/2017 2:58 AM, iivan wrote:
> I updated nginx to version 1.13.0
> This rule that was working correctly right now makes me mistake in the
> if ($host ~* ^(.*)\.website\.com$) {
>          set $sub_domain $1;
>          rewrite ^/(.*)?$
> /index.cfm?event=dashboard&lista=$sub_domain&nuovoURL=$1 last;
> }

ERR_TOO_MANY_REDIRECTS usually means that you have an infinite loop, which makes sense to me because you run this rule for every subdomain, including the rewritten one, causing the rewritten URL to be rewritten over and over again.

You need to rewrite it to a subdomain that would not match that rule.

Igal Sapir
Lucee Core Developer <>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list