Q: about "best" way for remove www in hostname in nginxish

B.R. reallfqq-nginx at yahoo.fr
Tue May 7 02:24:52 UTC 2013


You're right, my solution sucks... but it has the benefit of being generic.
I'll look into it.

Glad you found  a solution, though. ;o)
---
*B. R.*


On Mon, May 6, 2013 at 4:19 PM, Aleksandar Lazic <al-nginx at none.at> wrote:

> **
>
> I remember this and now also where I have seen it ;-)
>
> http://wiki.nginx.org/Pitfalls#Server_Name
>
> Thanks for all feedback.
>
> I will try the Solution written in first post.
>
> Br aleks
>
> Am 06-05-2013 20:30, schrieb B.R.:
>
>  I do:
> if ($host ~* "^www\.(.*)$") {
>     set "$domain" "$1";
>     rewrite (.*) http://$domain$uri permanent;
> }
>  ---
> *B. R.*
>
>
> On Mon, May 6, 2013 at 12:50 PM, Jonathan Matthews <
> contact at jpluscplusm.com> wrote:
>
>> That's how I do it, except that I hard-code a list of the domains I
>> want to redirect. Otherwise, I'd have built a service that could be
>> trivially used by anyone else for their own domain. Wildcards are bad,
>> mmkay? ;-)
>>
>> IMHO and YMMV,
>> Jonathan
>>
>> _______________________________________________
>> nginx mailing list
>> nginx at nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx
>>
>
> _______________________________________________
> nginx mailing listnginx at nginx.orghttp://mailman.nginx.org/mailman/listinfo/nginx
>
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20130506/028c2e88/attachment-0001.html>


More information about the nginx mailing list