Anybody successfully set up a proxy for a geoprocessing service involving file upload?

10-24-2018 05:06 PM
Occasional Contributor III

I have set up a proxy so my services can be secured and users don't need to login to the application, it just authenticates in the background with a token (users log into an application that the javascript api map sits inside of, so no need to log in again). The map server services work great, my data shows up as it should and everything works as expected. However, I cannot get my geoprocessing services to upload files because the input parameters (i.e. job ID) change with every submission so I don't know how to get the serverUrls in the proxy.config file to match. The documentation for the proxy settings in the config file also contradicts itself:

  • url: Location of the ArcGIS Server service (or other URL) to proxy. Specify either the specific URL or the root (in which case you should set matchAll="false").
  • matchAll="true": When true all requests that begin with the specified URL are forwarded. Otherwise, the URL requested must match exactly.

I would assume if it's the root URL you'd want to set matchAll to true so it'll match anything after the root. The "url" setting says the opposite what the matchAll setting says... either way, I've tried setting matchAll to both true and false and neither work. I still get errors like this in the console when trying to submit my file for upload to my GP service:

{"error": {"code": 403,"message":"Proxy has not been set up for this URL. Make sure there is a serverUrl in the configuration file that matches:

Current JS code:

                urlPrefix: "",
                proxyUrl: "/appName/proxy/proxy.ashx"

Current proxy.config file:

<ProxyConfig allowedReferers="*"
      <serverUrl url=""
      <serverUrl url=""
                 matchAll="true" />
      <serverUrl url=""
                 matchAll="true" />
0 Kudos
0 Replies