Entry path as Directory or Regular expression
Entry Path as Directory
The mapping behavior of trailing slashes depends on the chosen validator – see Option Enforce trailing slashes.
Example
- Virtual host: Name = ##External_FQDN_Generic## , Protocol = https
- Mapping:
Entry path = /private/ (directory)
Back-end path = / (directory) - Back-end host: IP = 123.234.132.1, Protocol = http
- Incoming => back-end request URL:
https://##External_FQDN_Generic##/private/ => http://123.234.132.1/
https://##External_FQDN_Generic##/private/index.html => http://123.234.132.1/index.html
https://##External_FQDN_Generic##/private/images/logo.gif => http://123.234.132.1/images/logo.gif
https://##External_FQDN_Generic##/private (no trailing slash) => the gateway sends redirect to http://##External_FQDN_Generic##/private/
The ignore-case icon behind the field determines if the entry path is treated case-insensitive, i.e. requests for the directory /CRM
should be sent to the same mapping as for the directory /crm
.
Entry Path as Regular Expression
The entry path is interpreted as a regular expression. A request matches the entry path if its URL path matches the specified regular expression. The ignore-case icon behind the field determines if the match is case-sensitive. If the entry path is a regular expression, the back-end path must be a replacement pattern that transforms the entry path to the back-end path. It normally contains back-references ($1, $2...$n
) that correspond to parts of the entry path (substrings in parentheses, see example below).
Any URL parameters (after the ?
in the URL) are not part of the entry path, these parameters will be ignored for the regular expression match. After constructing the back-end path, the parameters of the original request URL are appended to construct the complete back-end URL. It is not possible to append new parameters to the back-end URL.
The URL path of a request may match multiple regular expressions. For that reason, a unique priority must be chosen for each regular expression mapping.
Example
- Virtual host: Name = ##External_FQDN_Generic##, Protocol = https
- Mapping:
Entry path =^/session_([0-9A-F]{8})/(.*\.(gif|jpg|ico))$
(regular expression)
Back-end path =/session_$1/img/$2
(replacement pattern) - Back-end host: IP = 123.234.132.1, Protocol = http
- Incoming => back-end request URL:
https://##External_FQDN_Generic##/session_373E04C5/logo.jpg => http://123.234.132.1/session_373E04C5/img/logo.jpg
https://##External_FQDN_Generic##/session_373E04C5/test/space.gif => http://123.234.132.1/session_373E04C5/img/test/space.gif
The rewriting variables %ENTRYPATH%
and %BACKENDPATH%
cannot be used because their value is undefined for a regular expression mapping.