rewrite help
Glen Lumanau
glen at lumanau.web.id
Wed May 5 13:50:01 MSD 2010
Hi Igor,
It works already on index. But when i accessing
yahoo.example.com/test/article, it gives me error.
When i give proxy_pass http://www.example.com/site/yahoo.com$request_uri, it
giving me bad gateway
-----Original Message-----
From: Igor Sysoev [mailto:igor at sysoev.ru]
Sent: 05 Mei 2010 16:06
To: nginx at nginx.org
Subject: Re: rewrite help
On Wed, May 05, 2010 at 03:22:36PM +0700, Glen Lumanau wrote:
> I tried
>
> server {
> listen 80;
> server_name yahoo.example.com;
>
> rewrite ^.+ http://www.example.com/site/yahoo$uri last;
> }
>
> However it's not rewrited. It's being redirected to
http://www.example.com/site/yahoo
server {
server_name yahoo.example.com;
location / {
proxy_pass http://www.example.com/site/yahoo/;
}
}
server {
server_name google.example.com;
location / {
proxy_pass http://www.example.com/site/google/;
}
}
> -----Original Message-----
> From: Edho P Arief [mailto:edhoprima at gmail.com]
> Sent: 05 Mei 2010 15:16
> To: nginx at nginx.org
> Subject: Re: rewrite help
>
> On Wed, May 5, 2010 at 3:09 PM, Glen Lumanau <glen at lumanau.web.id> wrote:
> > Hi folks,
> >
> >
> >
> > I need a rewrite rules like this
> >
> >
> >
> > I have www.example.com, google.example.com, yahoo.example.com
> >
> >
> >
> > I need to rewrite
> >
> > Google.example.com à www.example.com/site/google
> >
> > Yahoo.example.com à www.example.com/site/yahoo
> >
> >
> >
> > How can I do that?
> >
>
> separate server block with rewrite on each blocks
>
>
>
> --
> O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx
>
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx
--
Igor Sysoev
http://sysoev.ru/en/
_______________________________________________
nginx mailing list
nginx at nginx.org
http://nginx.org/mailman/listinfo/nginx
More information about the nginx
mailing list