Apache Reverse Proxy

Best practice of securing your WebOffice 10.9 R6 application when providing it in the internet is to use a reverse proxy web server. The reverse proxy architecture enables you to run intranet and internet services using only one server installation. This reduces TCO (total cost of ownership) significantly (in comparison to double the server and software infrastructure).

 

Architecture of a reverse proxy

Architecture of a reverse proxy

 

icon_comment

•WebOffice 10.9 R6 is certified for Apache Reverse Proxy.

•Apache Tomcat Connector (used for redirecting HTTP port 80 requests from IIS to Apache Tomcat) does not support forwarding of specific HTTP header information that is needed for correct reverse proxy function. Therefore you must not take use of Apache Tomcat Connector when working with Apache Reverse Proxy and specific HTTP header attributes.

 

To work with Apache Reverse Proxy the configuration file httpd.conf (in <Apache installation folder>/conf) has to be customized. It is necessary that Apache Reverse Proxy transmits a certain header (syn_urlmap) so WebOffice 10.9 R6 can remap the URL.

 

 

The first step is to load the module mod_headers:

•open the httpd.conf file

•comment the line (2x): LoadModule headers_module modules/mod_headers.so

 

The second step is to configure the application and redirect paths. Beside the application path is necessary to provide every path that is accessed by WebOffice 10.9 R6 or ArcGIS Server, e.g. ArcGIS output location.

 

<Location /WebOffice>

 ProxyPass https://<SERVERNAME_intern>:8443/WebOffice/

 ProxyPassReverse https://<SERVERNAME_intern>:8443/WebOffice/

 RequestHeader set syn_urlmap https://<SERVERNAME_intern>:8443/WebOffice;https://<SERVERNAME_extern>/WebOffice|

 https://<SERVERNAME_intern>:6443/arcgis;https://<SERVERNAME_extern>/arcgis|

 /WebOffice_intern;/WebOffice_extern

</Location>

 

<Location /arcgis>

ProxyPass https://<SERVERNAME_intern>:6443/arcgis/

ProxyPassReverse https://<SERVERNAME_intern>:6443/arcgis/

</Location>

 

Structure of the syn_urlmap header

The header contains one or more mappings of the form map_from;map_to, separated by | (at most 32 mappings). WebOffice 10.9 R6 applies the mappings in the given order to its own address and to the content of the responses: every occurrence of map_from is replaced by map_to.

 

Part

Rules

map_from

Without special characters, map_from is compared literally; a dot stands for a dot. This is the usual case: the internal address or a path, e.g. https://<SERVERNAME_intern>:8443/WebOffice.

If map_from contains one of the characters \ ^ $ ? * + ( ) [ ] { }, it is evaluated as a regular expression. Only the following is supported:

•characters, the dot, punctuation escaped with \ (e.g. \.), \d \D \w \W \s \S and character classes in square brackets (not nested)

•?, * or + after a single character or a character class

•groups of single characters without repetition inside; the group may be optional with ?, e.g. (:8443)?

•lookahead and lookbehind of single characters, e.g. (?<!/extern)/WebOffice (prevents a path that has already been rewritten from being rewritten a second time)

•(?i) at the beginning, ^ at the beginning and $ at the end

Not supported are, among others, repetitions with curly braces ({n,m}), repeated or nested groups, back references, \b and other escape sequences, and inline options other than (?i).

map_to

•Starts with http:, https: or / (a path).

•At most 2048 characters, no quotation marks (" ' `), no angle brackets (< >) and no control characters.

•If map_from is a regular expression, groups can be inserted with $1 or ${name}; a dollar sign itself is then written as \$. With a literal map_from, $ and \ are taken over unchanged.

•The rules for map_to apply as of 10.9 R5.

 

Invalid header: If the header does not follow these rules (e.g. wrong format, empty map_from, more than 32 mappings, unsupported syntax, invalid expression or group reference), it is not used: the responses are not rewritten. The log contains a warning once per application run that starts with syn_urlmap (reverse proxy URL mapping) and names the number of the mapping concerned. The value of the header is not logged.

If a regular expression needs too much computing time for a response, or if rewriting would enlarge a response considerably, this response stays unchanged; a warning is logged for this as well.

 

icon_comment

•Set the header at the reverse proxy with RequestHeader set, not with add or append: set overwrites a syn_urlmap header that a client sends itself.

•If you do not use a mapping, remove the header at the reverse proxy: RequestHeader unset syn_urlmap.

•Apache Tomcat should only be reachable for clients through the reverse proxy.

 

 

icon_comment

•When using the JavaScript clients WebOffice flex and WebOffice core, problems may occur if a forward slash / is set at the end of the ProxyPass and ProxyPassReverse lines in the code. In this case please remove the slash at the end of the lines.

•When mapping the paths use both, absolute and relative paths. Be sure that the mapping of the relative paths is at the end of syn_urlmap.

•Since ArcGIS for Server 10.0 the locations for arcgiscache and arcgisoutput are not addressed directly anymore, but via arcgis.

•WebOffice extract server is configured for a virtual directory in IIS, which runs by default on port 80. Therefore you should not specify the port :8080 in the URL.

•It is always useful to restrict the access to certain pages like SynAdmin or certain jsp files. This can also be prevented by using the correct ProxyPass setting, whereby the exception is initiated by the exclamation mark (!). It is important to define the exception before configuring the actual proxy command; therefore use e.g. ProxyPass /WebOffice/synadmin !

Do not restrict externalcall.jsp.

 

icon_cross-reference

•You can find detailed information about the adjustment of ArcGIS Server when using a reverse proxy server on the web page https://server.arcgis.com/en/server/latest/administer/windows/using-a-reverse-proxy-server-with-arcgis-server.htm.

•Pay attention to GZIP filter.

•Pay attention to Explicitly Supported Scenarios for https.

•Configure external applications, tools and modules with the address as seen from the outside (i.e. after syn_urlmap), not with the internal one: see Passing the User Context to External Applications.