This configuration combines the previous two techniques. Both the station URL and ports are masked with aliases, and each unique station and its respective port number requires a ProxyPassMatch rule.
-
Set the station properties.
- Set
fiper.station.exposedname
to an identifier that the reverse proxy uses to map to the station:fiper.station.exposedname=StationAlias
Each station with an exposedname alias must have a matching rule in the reverse proxy configuration.
- Set
fiper.station.exposedports
to an identifier that the reverse proxy uses to mask the ports:fiper.station.exposedports=<port-range>:alias
-
Configure the reverse proxy rules.
ProxyPassMatch /StationAlias(:)alias0/([a-zA-Z0-9\S]+) http://station.domain.com$18080/$2
ProxyPassMatch /StationAlias(:)alias1/([a-zA-Z0-9\S]+) http://station.domain.com$18081/$2
etc.
where alias0
maps to port 8080 and StationAlias
maps to station.domain.com
.
Proxy rules should exist for all the remaining aliases as well as each unique StationAlias, as defined by the two station properties in step 1.
In this case, where $1 in the rerouted URL is substituted with : captured by the regular expression ":" and $2 is filled with the rest of the URL, alias0
maps to 8080 and StationAlias
maps to station.domain.com
. An example of the resulting proxified URL is:
https://hostname.domain.com:446/StationAlias:alias0/Advise/ping?caseID=4736.47061.1280.9430&_t=149384520431
For example, if fiper.station.exposedports=8080-8085:alias
and fiper.station.exposedname=MyStation
, then the ProxyPassMatch rules in italics below should be added:
Listen 446
<VirtualHost *:446>
SSLEngine on
ProxyPreserveHost Off
ServerAlias *domain.com
ProxyPass /SMAExeServer-REST http://myproxyserver.domain.com:port/SMAExeServer-REST
ProxyPassReverse /SMAExeServer-REST http://myproxyserver.domain.com:port/SMAExeServer-REST
ProxyPassMatch /MyStation(:)alias0/([a-zA-Z0-9\S]+) http://station.domain.com$18080/$2
ProxyPassMatch /MyStation(:)alias1/([a-zA-Z0-9\S]+) http://station.domain.com$18081/$2
ProxyPassMatch /MyStation(:)alias2/([a-zA-Z0-9\S]+) http://station.domain.com$18082/$2
ProxyPassMatch /MyStation(:)alias3/([a-zA-Z0-9\S]+) http://station.domain.com$18083/$2
ProxyPassMatch /MyStation(:)alias4/([a-zA-Z0-9\S]+) http://station.domain.com$18084/$2
ProxyPassMatch /MyStation(:)alias5/([a-zA-Z0-9\S]+) http://station.domain.com$18085/$2
RequestHeader set x-forwarded-port "446"
</VirtualHost>