forward by sub domain

Igor Sysoev is at rambler-co.ru
Sun Sep 23 10:10:17 MSD 2007


On Sat, Sep 22, 2007 at 04:50:43PM -0700, Alex Egg wrote:

> This works, but the app sitting at localhost:3000 is expecting the
> request to come from svn.mydomain.com. Since it sees the domain
> localhost, it errors out.
> 
> Is there  way to still proxy the request to localhost:300 but have it
> appear that it's from svn.mydomain.com?

             proxy_pass  http://localhost:3000;
             proxy_set_header  Host  svn.mydomain.com;

> On 9/21/07, Igor Sysoev <is at rambler-co.ru> wrote:
> > On Fri, Sep 21, 2007 at 09:54:54PM -0700, Alex Egg wrote:
> >
> > > How can I make nginx forward any request for svn.mydomain.com to localhost:3000?
> > >
> > > This is my current upstream snippet:
> > >
> > > upstream mongrel {
> > >     server 0.0.0.0:8000;
> > >     server 0.0.0.0:8001;
> > >     server 0.0.0.0:8002;
> > >     # forward svn.mydomain.com to 0.0.0.0:3000 here
> > >   }
> >
> > http {
> >
> >     upstream  mongrel {
> >        ...
> >     }
> >
> >     server {
> >        ....
> >     }
> >
> >     server {
> >         server_name  svn.mydomain.com;
> >
> >         location / {
> >             proxy_pass  http://localhost:3000;
> >         }
> >     }
> >
> > Do you plan to work read only with svn ?
> >
> >
> > --
> > Igor Sysoev
> > http://sysoev.ru/en/
> >
> >
> 

-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list