Re: Sub-domain in variable

2014-08-02 Thread franciscRO
What is the working form of this? I want to redirect all *.*.* to *.* (e.g. sub.domain.tld to domain.tld) because I have different domains and tdls. Any help appreciated. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,237799,252229#msg-252229 __

Re: Sub-domain in variable

2013-03-26 Thread huttarichard
Ok, I love u :D! Work perfectly... I solved all thx :) Posted at Nginx Forum: http://forum.nginx.org/read.php?2,237799,237816#msg-237816 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx

Re: Sub-domain in variable

2013-03-26 Thread Nikolas Stevenson-Molnar
The "www" part is probably causing a problem too. As the regex is written it will only match "www..." which I'm guessing isn't what you intent. I would instead treat "www" as another possible subdomain. ~^(?[^\.]*\.)?(?[^\.]*)\.(?[^\.*)$ Note I haven't tested this, but it's similar to a pattern I

Re: Sub-domain in variable

2013-03-26 Thread huttarichard
Thanks lot, but still wont to work. And how i set $subdomain to "default" if subdomain doesnt exists? I try this: ~^(www\.)(?[^\.]*)(?[^\.]*)\.(?[^\.]*)$ Posted at Nginx Forum: http://forum.nginx.org/read.php?2,237799,237814#msg-237814 ___ nginx maili

Re: Sub-domain in variable

2013-03-26 Thread Nikolas Stevenson-Molnar
Check your subdomain regex. Right now, if will only work if your subdomain is a dot ;) It should be (?[^\.]*) or (?[^\.]+) _Nik On 3/26/2013 5:56 AM, huttarichard wrote: > Hi guys, > > I have question. My server_name looks like this: > > server_name ~^(www\.)(?[^\.]*)\.(?[^\.]*)$; > > but I nee

Sub-domain in variable

2013-03-26 Thread huttarichard
Hi guys, I have question. My server_name looks like this: server_name ~^(www\.)(?[^\.]*)\.(?[^\.]*)$; but I need, for my website do subdomains. I try: server_name ~^(www\.)?(?\.)(?[^\.]*)\.(?[^\.]*)$; but won't work for me. And what will be super, if subdomain emtpy se to default (mean stri