On 16 April 2013 15:47, David | StyleFlare <david@styleflare.com> wrote:
> Pardon me if I missed this in the docs...
>
> My issue is that I want to rewrite every domain and not create a server
> block for each.
>
> I am trying to rewrite every domain thats pointing to Nginx
>
> from www.server.com to server.com
Have a single separate server block do it for you:
server {
listen 80;
server_name ~^(www\.)(?<domain>.+)$;
rewrite $scheme://$domain$uri$is_args$args;
}
(written but not tested; YMMV!)
Jonathan
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx