From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.64.37.230 with SMTP id b6csp433153iek; Sat, 22 Sep 2012 02:58:04 -0700 (PDT) Return-Path: Received-SPF: pass (google.com: domain of rack-devel+bncBDTLL3HA74NRBK4X62BAKGQECEPTGOY@googlegroups.com designates 10.236.180.41 as permitted sender) client-ip=10.236.180.41 Authentication-Results: mr.google.com; spf=pass (google.com: domain of rack-devel+bncBDTLL3HA74NRBK4X62BAKGQECEPTGOY@googlegroups.com designates 10.236.180.41 as permitted sender) smtp.mail=rack-devel+bncBDTLL3HA74NRBK4X62BAKGQECEPTGOY@googlegroups.com; dkim=pass header.i=rack-devel+bncBDTLL3HA74NRBK4X62BAKGQECEPTGOY@googlegroups.com Received: from mr.google.com ([10.236.180.41]) by 10.236.180.41 with SMTP id i29mr3306164yhm.4.1348307884088 (num_hops = 1); Sat, 22 Sep 2012 02:58:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=x-beenthere:date:from:to:message-id:subject:mime-version :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=rm4/n05EU/zDa4N+lV0YBAJxH2ASP+GAZBHa+kVL6G4=; b=Ml448eahA/cuku7wO3zNiHIly9g3eWcElUHLcguzl+RHB4MfXnOHd8po31CpqLa7Ja sTX2swCTxuesYif4pfQn9nR87zMuWFlIh9JhCc6D41ctFABls+UvxHXfoaGH5nSuV4UW /UAXx+7P18Pp5jWEsxBKF+QSg5Db4t2jH4D9BryjKy0X0ARFviOHztPwV89UB9rgw/JJ ZngA0b4pBpGqe09+FlIrtMAH9aKG0ZzWxx1Ps33LJCRQNV8AnA2gchFwocJlWyTMuP9C LK7BHxV2a6ZrRM5Gow+lGuVF8oo0WXHq09opREtu1DR1p9vubMkoVdyhXHxthXcrgDOj RW/Q== Received: by 10.236.180.41 with SMTP id i29mr974343yhm.4.1348307883820; Sat, 22 Sep 2012 02:58:03 -0700 (PDT) X-BeenThere: rack-devel@googlegroups.com Received: by 10.236.126.33 with SMTP id a21ls6775977yhi.3.gmail; Sat, 22 Sep 2012 02:58:01 -0700 (PDT) Received: by 10.236.180.41 with SMTP id i29mr974328yhm.4.1348307881107; Sat, 22 Sep 2012 02:58:01 -0700 (PDT) Date: Sat, 22 Sep 2012 02:58:00 -0700 (PDT) From: armanx To: rack-devel@googlegroups.com Message-Id: <4c36a997-d560-4115-9261-1c0a7b7c24c9@googlegroups.com> Subject: Possible to read request's host in config.ru? MIME-Version: 1.0 X-Original-Sender: armanx@gmail.com X-Original-Authentication-Results: ls.google.com; spf=pass (google.com: domain of armanx@gmail.com designates internal 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="----=_Part_759_16108636.1348307880588" ------=_Part_759_16108636.1348307880588 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 ------=_Part_759_16108636.1348307880588 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Is it possible to detect the incoming request's domain name (host) in confi= g.ru? I'm trying to use URLMap to map different domains to different a= pps, all running on the same IP. Theoretically, I'm trying to achieve this = effect:

map 'http://exampl= e1.com' do
=09<= /span>run MyApp::Example1
end
=  
 
map 'http://example2.com' do
=09run MyApp::Example2
en= d


For example, if it w= as possible to read rack's SERVER_NAME in config.ru, I would do something l= ike:

if SERVER_NAME =3D= =3D 'example1.com'
=09map '/' do
=09=09run MyApp::Example1
=09end
end
 
------=_Part_759_16108636.1348307880588--