Set Up a Proxy Page for the HTML5 Viewer

There are two reasons why you might use a proxy page with the HTML5 Viewer:

The HTML5 Viewer installation package includes proxy pages for ASP.NET, Java (JSP), and PHP. These proxy pages are based on the ones that Esri provides for the ArcGIS API for JavaScript. For more information, refer to Using the Proxy in Esri's ArcGIS API for JavaScript documentation.

Use the ASP.NET Proxy Page that Ships with the Viewer

To configure the ASP.NET proxy page to work with your HTML5 viewers:

These instructions assume that you deployed the HTML5 Viewer template to IIS.

  1. If ASP.NET 2.0 or newer is not installed on the server where the Geocortex Viewer for HTML5 is deployed, install it now and register it with IIS.

    The ASP.NET proxy page requires ASP.NET 2.0 or newer.

  2. If you want to deploy the proxy page to a custom location:

    1. Move or copy the proxy.ashx and proxy.config files to the desired location.

      By default, proxy.ashx and proxy.config are in the folder where you deployed the Geocortex Viewer for HTML5. The location that you copy the proxy files to must be known to your web server.

    2. In IIS Manager, convert the folder containing proxy.ashx and proxy.config to an application that uses a .NET 2.0 or newer application pool.

    3. For each HTML5 viewer that you have added to a site, configure the proxy's URI using one of the following methods:

      • In Manager, edit the viewer. In the side panel, click Application. In the Proxy URI box, type the location of your proxy. Click Apply Changes and Save Site.

      • Alternatively, open the viewer's three configuration files in a text editor and update each file's proxyUri element to point to the proxy location.

  3. Run a text editor as an administrator and edit proxy.config.

    The proxy.config file is used to configure the ArcGIS Server services that the proxy will forward to. By default, the proxy.config file is in C:\inetpub\wwwroot\Html5Viewer.

  4. Add a serverUrl element for each of your servers.

    Alternatively, modify any of the default server.url elements that you do not need.

    You must have a serverUrl element for each geocoding service that you use. For information on configuring geocoding services, see Geocoding Services.

    The serverUrl element has the following attributes:

    • url: The location of the server.

    • matchAll: Set to true to forward every request that begins with the url.

    • token: (optional) The security token to include for a secured service.

    • dynamicToken: Set to true to get the token dynamically using the user name and password that are stored in the appSettings section of the server's web.config file.

    By default, the ProxyConfig element's mustMatch attribute is set to true. This prevents viewer access to any address that is not specified in the serverUrls.

  5. Save the proxy.config file.

  6. If your site accesses services that are secured using Windows Authentication, follow the instructions in Adapt the ASP.NET Proxy Page to Access Windows-Secured Servers below.

Adapt the ASP.NET Proxy Page to Access Windows-Secured Servers

We recommend that you avoid securing your ArcGIS services with Basic Authentication because editing will not work if the ArcGIS services and the HTML5 Viewer are hosted on different servers. Use Windows Authentication instead.

You must configure the proxy to access Windows-secured servers if either:

To adapt the ASP.NET proxy page to access Windows-secured servers:

Step 1: Configure authentication in IIS

  1. In IIS Manager, expand the Connections panel's folders to show the location where you deployed the Viewer.

  2. Click the Viewer. By default, its name is Html5Viewer.

    The center panel shows the Features View.

  3. In the IIS section, double-click Authentication .

    The center panel shows the authentication settings.

  4. Right-click ASP.NET Impersonation and select Enable.

    Some versions of IIS call this option "Windows Impersonation" instead of "ASP .NET Impersonation". If your version of IIS does not have an ASP .NET Impersonation option, enable Windows Impersonation.

  5. Right-click Windows Authentication and select Enable.

    Do not close IIS Manager yet.

Step 2: Configure the proxy to forward the credentials

  1. In IIS Manager, right-click the Viewer and click Explore.

    Windows Explorer will open to the folder that contains the proxy page.

  2. Open the proxy.config file in a text editor.

  3. Add a new serverUrl element.

  4. Add a url attribute to the new serverUrl element and set the attribute to the URL of your Windows-secured server.

  5. Add a matchAll attribute to the new serverUrl element and set it to true.

    The markup should look similar to the following, with server.domain.com replaced by your host name.

    • Windows-secured ArcGIS Service:

      <serverUrl url="http://server.domain.com/arcgis/rest/services/" matchAll="true"></serverUrl>
    • Windows-secured Essentials Server:

      <serverUrl url="http://server.domain.com/geocortex/essentials" matchAll="true"></serverUrl>

    If you are using Esri's proxy page instead of the one that ships with the HTML5 Viewer, you must add the Essentials server and set its useAppPoolIdentity attribute to true so that it looks similar to the following:

    <serverUrl url="http://server.domain.com/geocortex/essentials" matchAll="true" useAppPoolIdentity="true"></serverUrl>

    To determine if you are using Esri's proxy page, search the proxy.ashx file for useAppPoolIdentity.

  6. Save the file and close the editor.

  7. Close IIS Manager.