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=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: AWS combined dispatcher Virtual host and URI Date: Mon, 20 Apr 2020 15:20:28 +0200 Organization: Adalog Message-ID: References: <0edc4b64-ac90-463c-920a-3ff92a8be434@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Mon, 20 Apr 2020 13:20:27 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="9b68c8ede2de515934f7f75f293192f6"; logging-data="13673"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/B1OQyqAEM3+WLz3xBRTRm" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 Cancel-Lock: sha1:LXMzvydnwYLahrgG6It7XtPNOAo= In-Reply-To: Content-Language: fr Xref: reader01.eternal-september.org comp.lang.ada:58432 Date: 2020-04-20T15:20:28+02:00 List-Id: 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)); -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr