Uploaded image for project: 'appNG'
  1. appNG
  2. APPNG-2442

Host Alias support for appNG sites

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Done
    • Priority: Medium
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 1.25.0
    • Component/s: None
    • Labels:
      None

      Description

      AppNG maps requests to sites by inspecting request attributes and matching them against site configurations.

      On the request side the following attribute will be fetched:

      • The client IP if vHostMode is IP_BASED.
      • The first of the following attributes, that is available, if vHostMode is NAME_BASED:
        • ServletRequest attribute "SERVER_LOCAL_NAME" (typically set by an AJP connector of a reverse proxy or loadbalancer in front of appNG)
        • HTTP header "X_APPNG_SITE" of the request (typically used in the same setup in conjunction with an HTTP connector)
        • HTTP header "Host" of the request (ServletRequest.getServerName())

      The resulting attribute is checked against the sites' "name" property and if that doesn't match, against the "host" property. The first matching site handles the request.

      Currently appNG sites only support one "name" and one "host" attribute per site. This is rarely a problem, when running behind a reverse proxy, because proxies are usually capable of mapping different names to a specific value in "SERVER_LOCAL_NAME" or "X_APPNG_SITE". In a setup without reverse proxy, there is normally more than one name, that the site should react on (e.g. a site serving "mydomain.com", should also react on "www.mydomain.com").

      The new feature should implement alias names for the "host" attribute (subsequently called host-aliases).

      Constraints:

      • Although it would be handy to allow wildcards within host or host-alias, this will not be implemented.
      • Wildcards would make it expensive (if not impossible), to detect overlapping wildcard-matches within different sites.
      • Having two sites matching the same name, could lead to unpredictable mappings.
      • Changing host or host-aliases within one site could break another site without that being obvious.

      Scope of the change:

      • Sites will be able to define one or more host-alias entries.
      • The name-to-site mapping logic will be extended to match host-alias entries for all mechanisms 1. to 3.
      • The implementation will guarantee all host and host-alias values to be globally unique (see constraints).
      • GUI support for defining host-alias entries will be added to the appng-manager application.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                heuvels.dirk Dirk Heuvels
                Reporter:
                heuvels.dirk Dirk Heuvels
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: