From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.64.37.230 with SMTP id b6csp435377iek; Sat, 22 Sep 2012 03:32:35 -0700 (PDT) Return-Path: Received-SPF: pass (google.com: domain of rack-devel+bncBDTLL3HA74NRBQNH62BAKGQEKUIC2VY@googlegroups.com designates 10.204.133.195 as permitted sender) client-ip=10.204.133.195 Authentication-Results: mr.google.com; spf=pass (google.com: domain of rack-devel+bncBDTLL3HA74NRBQNH62BAKGQEKUIC2VY@googlegroups.com designates 10.204.133.195 as permitted sender) smtp.mail=rack-devel+bncBDTLL3HA74NRBQNH62BAKGQEKUIC2VY@googlegroups.com; dkim=pass header.i=rack-devel+bncBDTLL3HA74NRBQNH62BAKGQEKUIC2VY@googlegroups.com Received: from mr.google.com ([10.204.133.195]) by 10.204.133.195 with SMTP id g3mr2074593bkt.15.1348309955085 (num_hops = 1); Sat, 22 Sep 2012 03:32:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=x-beenthere:received-spf:mime-version:in-reply-to:references:date :message-id:subject:from:to:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-google-group-id:list-post:list-help:list-archive:sender :list-subscribe:list-unsubscribe:content-type; bh=8dXGo0J6rmfkJXYY8JraiP0I7IDCoS1Erh+j4LPSsrI=; b=KB60526hU8olEWmJNpKDgyv3+btEcmkTn+Ev3YN+u5s2YJCSwpFlCAWad3eVkRU86Y KnoIQfzpnk+VkvhFCsPnaqwDItST9PKIKsHfZLNltKwyHVJiv8E8Ff+aMBgAosq87aw9 DG6CYqab/rh0doOAO90tBIArnK39g+w6pnahihdo0mTqY3XeXH3hrz4+FBn+8vDC5d30 tslFl4/4n5fDfHuYA3q92ZgGxt4WAAjETlTtUE1c9jRe0bEDvvAW2RDN2qtG3eLc950l qKklcW/5EzNDKV23E3BCY5qvauJufQVmDDRk9JiS3cBiOHwHeCM6v4wMECeGR+8R2d23 EQKQ== Received: by 10.204.133.195 with SMTP id g3mr632391bkt.15.1348309954142; Sat, 22 Sep 2012 03:32:34 -0700 (PDT) X-BeenThere: rack-devel@googlegroups.com Received: by 10.204.13.17 with SMTP id z17ls4455276bkz.5.gmail; Sat, 22 Sep 2012 03:32:30 -0700 (PDT) Received: by 10.204.148.22 with SMTP id n22mr698381bkv.0.1348309950789; Sat, 22 Sep 2012 03:32:30 -0700 (PDT) Received: by 10.204.148.22 with SMTP id n22mr698380bkv.0.1348309950767; Sat, 22 Sep 2012 03:32:30 -0700 (PDT) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com [209.85.217.181]) by gmr-mx.google.com with ESMTPS id 27si223719bks.3.2012.09.22.03.32.30 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 22 Sep 2012 03:32:30 -0700 (PDT) Received-SPF: pass (google.com: domain of armanx@gmail.com designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by mail-lb0-f181.google.com with SMTP id gg6so45826lbb.26 for ; Sat, 22 Sep 2012 03:32:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.41.232 with SMTP id i8mr2578761lbl.48.1348309950478; Sat, 22 Sep 2012 03:32:30 -0700 (PDT) Received: by 10.112.29.41 with HTTP; Sat, 22 Sep 2012 03:32:30 -0700 (PDT) Received: by 10.112.29.41 with HTTP; Sat, 22 Sep 2012 03:32:30 -0700 (PDT) In-Reply-To: References: <4c36a997-d560-4115-9261-1c0a7b7c24c9@googlegroups.com> Date: Sat, 22 Sep 2012 03:32:30 -0700 Message-ID: Subject: Re: Possible to read request's host in config.ru? From: Arman To: rack-devel@googlegroups.com X-Original-Sender: armanx@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of armanx@gmail.com designates 209.85.217.181 as permitted sender) smtp.mail=armanx@gmail.com; dkim=pass header.i=@gmail.com Reply-To: rack-devel@googlegroups.com Precedence: list Mailing-list: list rack-devel@googlegroups.com; contact rack-devel+owners@googlegroups.com List-ID: X-Google-Group-Id: 486215384060 List-Post: , List-Help: , List-Archive: Sender: rack-devel@googlegroups.com List-Subscribe: , List-Unsubscribe: , Content-Type: multipart/alternative; boundary=e0cb4efa6daea53ac404ca47df2b --e0cb4efa6daea53ac404ca47df2b Content-Type: text/plain; charset=UTF-8 Thanks for the quick answer. This definitely works. Our of curiosity, is it possible to see the host and other request information in config.ru? On Sep 22, 2012 3:04 AM, "Magnus Holm" wrote: > It's already supported, you just need the trailing slash: > > map 'http://example1.com/' do > run MyApp::Example1 > end > > // Magnus Holm > > > On Sat, Sep 22, 2012 at 11:58 AM, armanx wrote: > > Is it possible to detect the incoming request's domain name (host) in > > config.ru? I'm trying to use URLMap to map different domains to > different > > apps, all running on the same IP. Theoretically, I'm trying to achieve > this > > effect: > > > >> map 'http://example1.com' do > >> run MyApp::Example1 > >> end > >> > >> > >> > >> > >> > >> map 'http://example2.com' do > >> run MyApp::Example2 > >> end > > > > > > > > For example, if it was possible to read rack's SERVER_NAME in config.ru, > I > > would do something like: > > > >> if SERVER_NAME == 'example1.com' > >> map '/' do > >> run MyApp::Example1 > >> end > >> end > > > > > --e0cb4efa6daea53ac404ca47df2b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Thanks for the quick answer. This definitely works.

Our of curiosity, is it possible to see the host and other request infor= mation in config.ru?

On Sep 22, 2012 3:04 AM, "Magnus Holm"= <judofyr@gmail.com> wrote:<= br type=3D"attribution">
It's already supported, you just need the trailing slash:

map 'http://example1= .com/' do
=C2=A0 run MyApp::Example1
end

// Magnus Holm


On Sat, Sep 22, 2012 at 11:58 AM, armanx <armanx@gmail.com> wrote:
> Is it possible to detect the incoming request's domain name (host)= in
> config.ru? I'm = trying to use URLMap to map different domains to different
> apps, all running on the same IP. Theoretically, I'm trying to ach= ieve this
> effect:
>
>> map 'http://= example1.com' do
>> run MyApp::Example1
>> end
>>
>>
>>
>>
>>
>> map 'http://= example2.com' do
>> run MyApp::Example2
>> end
>
>
>
> For example, if it was possible to read rack's SERVER_NAME in config.ru, I
> would do something like:
>
>> if SERVER_NAME =3D=3D 'example1.com'
>> map '/' do
>> run MyApp::Example1
>> end
>> end
>
>
--e0cb4efa6daea53ac404ca47df2b--