Welcome! Log In Create A New Profile

Advanced

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

May 06, 2013 12:50PM
I just do

server {
listen 80;
server_name was.foo.com;
rewrite ^ http://foo.com$uri permanent;
}


On May 6, 2013, at 9:40 AM, Aleksandar Lazic <al-nginx@none.at> wrote:

> Dear readers,
>
> after reading
>
> http://nginx.org/en/docs/http/server_names.html#regex_names
>
> and googleing
>
> https://www.google.at/search?q=nginx+remove+www+subdomain
>
> I have a 'best solution' question.
>
> I have the following customer request.
>
> The 'normal User' type almost every time a www.subdomain.domain.at into they browser,
> which does not exist but the subdomain.domain.at exists.
>
> I would now add the follwing into my nginx.conf.
>
> ###
> server {
> server_name ~^(www\.)?(?<domain>.+)$;
>
> return http://$domain/;
> }
> ###
>
> Is this the cleanest way in nginxish?
>
> Thanks for help
> Aleks
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
SubjectAuthorPosted

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

Aleksandar LazicMay 06, 2013 12:42PM

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

mikeMay 06, 2013 12:50PM

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

Jonathan MatthewsMay 06, 2013 12:52PM

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

B.R.May 06, 2013 02:32PM

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

Aleksandar LazicMay 06, 2013 04:22PM

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

B.R.May 06, 2013 10:26PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 105
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 229 on August 01, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready