17 messages in ru.sysoev.nginxRe: forward by sub domain
FromSent OnAttachments
Alex EggSep 21, 2007 9:54 pm 
Igor SysoevSep 21, 2007 11:57 pm 
Alex EggSep 22, 2007 12:02 am 
Alex EggSep 22, 2007 12:08 am 
Igor SysoevSep 22, 2007 12:13 am 
Igor SysoevSep 22, 2007 12:17 am 
Alex EggSep 22, 2007 12:46 pm 
Alex EggSep 22, 2007 4:50 pm 
Wayne E. SeguinSep 22, 2007 7:09 pm 
BJ ClarkSep 22, 2007 8:18 pm 
Igor SysoevSep 22, 2007 11:09 pm 
Wayne E. SeguinSep 23, 2007 6:18 am 
Alex EggSep 23, 2007 9:53 am 
Alex EggSep 23, 2007 10:28 am 
Denis F. LatypoffSep 23, 2007 10:38 am 
Igor SysoevSep 23, 2007 10:44 am 
Alex EggSep 23, 2007 10:53 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: forward by sub domainActions...
From:Igor Sysoev (is-G@public.gmane.org)
Date:Sep 23, 2007 10:44:10 am
List:ru.sysoev.nginx

On Mon, Sep 24, 2007 at 12:38:44AM +0700, Denis F. Latypoff wrote:

Hello Alex,

Monday, September 24, 2007, 12:28:41 AM, you wrote:

Sorry, but I have one more question!

This works fine for svn.mydomain.com

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

But, I need support for this url scheme *.svn.mydomain.com. So * is any subdomain under svn. How can the below config be modified to accommodate this?

server {

- server_name svn.mydomain.com; + server_name svn.mydomain.com *.svn.mydomain.com;

or server_name .svn.mydomain.com;

location / { proxy_pass http://localhost:3000;

- proxy_set_header Host svn.mydomain.com; + proxy_set_header Host $host;

} }

So if the the url is svn.mydomain.com it gets proxied to localhost:3000 as svn.mydomain.com

And if the url is my_project.svn.mydomain.com it gets proxied to localhost:300 as my_project.svn.mydomain.com

Is this possbile/

On 9/22/07, Igor Sysoev <is-G@public.gmane.org> wrote:

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-G@public.gmane.org> 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 ?