Edho Arief Wrote:
-------------------------------------------------------
> On Sun, Jul 7, 2013 at 6:30 PM, lennart <[email protected]> wrote:
> >
> > Is there a way to do this with regex or variables? I've ~15 domains
> and it
> > would be more convenient to have only one entry "to rule them all"
> ;-)
> >
> 
> the regex way, which is supposedly slower:
> 
> server {
>   server_name ~^www\.(?<domain>.+)$;
>   listen 80; listen [::]:80;
>   return 301 $scheme://$domain$request_uri;
> }
> 
> --
> O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
> 
> _______________________________________________
> nginx mailing list
> [email protected]
> http://mailman.nginx.org/mailman/listinfo/nginx

'supposedly slower' is a very good argument to not use RegEx ;-) Do you have
a source for that?

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,240622,240679#msg-240679

_______________________________________________
nginx mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to