Nginx rule for subdomains: ERR_TOO_MANY_REDIRECTS

Igal @ Lucee.org igal at lucee.org
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
> browser: ERR_TOO_MANY_REDIRECTS
>
> 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
Lucee.org <http://lucee.org/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20170607/435e2cd6/attachment.html>


More information about the nginx mailing list