IIS/ARR Proxy for GeoEvent Server & Stream Services

980
0
06-27-2022 07:39 AM
YujingWu
Esri Contributor
4 0 980

Third-party software integrations, such as IIS Application Request Routing (ARR), can be very challenging because it requires in-depth knowledge of each participating component. This includes details such as system requirements, external dependencies, as well as changes between releases. For that reason, Esri does not provide formal documentation on configuration of non-Esri software. However, for users who would like to leverage ARR with GeoEvent Server, this blog outlines the configuration we use in-house to implement the rules for GeoEvent Manager and stream services, originally provided to me by @JoshJoyner from our team. 

Before we start, make sure IIS and ARR have been installed. In this blog, our implementation uses IIS 10 and ARR 3. The version of GeoEvent server is 10.9.1.  

Enable Proxy on IIS 

Run IIS as the administrator and navigate to the Application Request Routing Cache. Click on the Server Proxy Settings on the rightmost toolbar as seen in Figure 1 below. After it takes you to the configuration page for ARR, check the box next to Enable proxy near the top of the page. Click on the Apply button to make sure it’s saved. 

YujingWu_0-1655992274048.png

Figure 1. Homepage for Application Request Routing Cache  

 

Add Server Variable to IIS 

After proxy is enabled, go to your Default Web Site Home and click on the icon for URL Rewrite. On the toolbar on the right, under Manager Server Variables, click on View Server Variables as seen in Figure 2 below. 

YujingWu_1-1655992274049.png

Figure 2. Homepage for URL Rewrite 

After reaching the list of allowed server variables, click on the Add button and add a server variable named “HTTP_SEC_WEBSOCKET_EXTENSIONS”.  Navigate back to the homepage of URL Rewrite.  

 

Configure Rule for GeoEvent Manager  

Click on Add Rules and select the Blank rule template within the Inbound rules section and give it a name. The screenshot below (Figure 3) shows an example configuration of the rule for GeoEvent Manager. The hostname and domain should be replaced with your ArcGIS GeoEvent Server’s hostname and domain. This rule replaces any part of a request pattern starting with the path element ‘geoevent/’. One thing to note is that in the Server Variables section, we are replacing HTTP_SEC_WEBSOCKET_EXTENSIONS with “;”. This is because ARR does not support the compression of WebSocket data packets, and we need to remove the header portions of connection requests that enable that capability. 

YujingWu_0-1655993635550.png

Figure 3. Inbound rule for GeoEvent Manager  

After the rule is configured, click on the Apply button on the right to make sure it’s saved. 

 

Configure Rule for Stream Services

For stream service, an extra step is needed to configure ArcGIS Server first. Navigate to your ArcGIS Server Administrator Directory. Go to system -> properties and add a WebSocketContextURL (Figure 4). As an example, the URL we use is wss://{GeoEvent hostname}.{GeoEvent domain}.com/stream, which corresponds to the pattern used in the inbound rule we will create for stream service. After the property has been added, click on any of the stream services on this server. Its web socket URL should reflect the change.  

YujingWu_2-1655993721812.png

Figure 4. System properties of ArcGIS Server  

Go to IIS again and add another rule for stream service. The screenshot below (Figure 5) shows an example of the configuration. Again, the hostname and domain should be replaced with with your GeoEvent Server’s hostname and domain.  

YujingWu_3-1655994054214.png

Figure 5. Inbound rule for stream service

After the rule has been created and applied, go to one of the stream services and verify you are able to subscribe to it (Figure 6).  

YujingWu_0-1656080756646.png

 

Testing your IIS/ARR Configuration

Here are some example URLs of GeoEvent Manager and stream service before and after being rewritten by IIS.

GeoEvent Manager:

  • External URL (this is the URL to enter in a browser to access GeoEvent Manager) 
    • Pattern: https://{GeoEvent hostname}.{GeoEvent domain}.com/geoevent/manager
    • Actual URL example: https:// realtimegis.esri.com/geoevent/manager 
  • Rewritten URL
    • Pattern: https://{GeoEvent hostname}.{GeoEvent domain}.com:6143/geoevent/manager
    • Actual URL example: https:// realtimegis.esri.com:6143/geoevent/manager 

Stream Service:

  • External URL (this is the web socket URL the browser requests to subscribe to) 
    • Pattern: wss://{GeoEvent hostname}.{GeoEvent domain}.com/stream/ws/services/{name of the stream service}/StreamServer/subscribe
    • Actual URL example: wss://realtimegis.esri.com/stream/ws/services/vehicles/StreamServer/subscribe
  • Rewritten URL
    • Pattern: https://{GeoEvent hostname}.{GeoEvent domain}.com:6143/arcgis/ws/services/{name of the stream service}/StreamServer/subscribe
    • Actual URL example: https:// realtimegis.esri.com:6143/arcgis/ws/services/vehicles/StreamServer/subscribe