From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,NUMERIC_HTTP_ADDR, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: AWS combined dispatcher Virtual host and URI Date: Tue, 21 Apr 2020 16:25:37 -0500 Organization: JSA Research & Innovation Message-ID: References: <0edc4b64-ac90-463c-920a-3ff92a8be434@googlegroups.com> Injection-Date: Tue, 21 Apr 2020 21:25:38 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="12297"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader01.eternal-september.org comp.lang.ada:58456 Date: 2020-04-21T16:25:37-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:r7kcjg$1543$1@gioia.aioe.org... > On 2020-04-20 15:20, J-P. Rosen wrote: >> Le 20/04/2020 à 13:25, Dmitry A. Kazakov a écrit : >>>> I don't want to see Virtual hosts as aliases, but as distinct >>>> different hosts: "http://personal_domain/gallery" and >>>> "http://company_domain/gallery" should serve two different galleries. >>> >>> You mean you want to add the domain name to the map's key "gallery" in >>> order to distinguish different contents? How this is supposed to work if >>> both domain names are resolved to the same IP address and the client >>> uses the address? >> >> I've done that for a long time. If you query, you'll see that adalog.fr, >> www.adalog.fr, adenothe.org all refer to the same IP address... >> >> I have a real root directory (configured in the server config file), >> with subdirectories named like the root URL of each virtual host. Here >> is how I compute the root directory for each virtual host: >> >> Hostname : constant String := Status.Host (Request); >> K : constant Natural := Index (Hostname, ":", Backward); >> Host_Root : constant String := WWW_Root >> (Server.Config >> (Server.Get_Current.all)) >> & (if K = 0 >> then Hostname >> else Hostname (1 .. K-1)); > > You are using the HTTP header "Host", right? But if the URI deploys the IP > address like: > > http://192.168.1.1/gallery > > The host header is meant to serve as an alias, but there is no guarantee > it would work, only if the client cooperates. I do something similar on the Ada-Server. Bare IP addresses are treated as a different host (and essentially point to an empty web site). It might break someone's not very well designed tool, but it doesn't matter to any of the major browsers or search bots -- and those are the customers, not the SEO bots and other criminals that may visit. (SEO bots often use IP-only addresses.) Randy.