nginx server redirect

Kevin Castiglione kevincastiglione at gmail.com
Sun Jun 21 17:21:36 MSD 2009


On Sat, Jun 20, 2009 at 10:30 PM, Edho P Arief <edhoprima at gmail.com> wrote:

> On Sun, Jun 21, 2009 at 12:19 PM, Edho P Arief<edhoprima at gmail.com> wrote:
> >
> > here it is
> >        server {
> >                listen 80;
> >                server_name ~(.*)\.([^\.]*)\.([^\.]*)$;
> >                set $domain $2.$3;
> >                rewrite ^.* http://$domain$request_uri permanent;
> >        }
> >
> make sure that you have the server_name set on nginx or it'll redirect to .

can you tell how i set server_name on nginx for this to work?



> this will catch all anydomain.tld
>        server {
>               listen 80;
>               server_name ~[^\.]*\.[^\.]*;
>               return 403;
>         }
>
i dont understand what you mean by catch all anydomain.tld?
can you pl. explain this?
thanks a lot!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20090621/1b18cf8c/attachment.html>


More information about the nginx mailing list