How to Configure Proxy in Client page ?

500
1
Jump to solution
03-05-2018 05:40 AM
SivaramKrishnan2
New Contributor III

Hi,

We are trying to access the mapservice through proxy server , because we do not want expose mapservice url to the end user.


We have added this urlutil proxy in "html file"

The proxy.config file will have the below configuration.

Now I want to add mapservice URL (from proxy) to my application

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

Sivaram,

   The url prefix used in your urlUtils urlPrefix need to have an identical prefix (including protocol) as what you are using in your proxy.config serverUrl and what you use in your FeatureLayer url. 

Here is an example:

urlPrefix: http://myserver.com

proxy.config serverUrl: http://myserver.com matchAll='true'

FeatureLayer url: http://myserver.com/arcgis/rest/services/myservice/0

Notice. that the urlPrefix and serverUrl is less specific so that every service from myserver.com will be covered.

Also notice each url is using the same http protocol if you are using https then all need to have that same https protocol in the url.

View solution in original post

0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Esteemed Contributor

Sivaram,

   The url prefix used in your urlUtils urlPrefix need to have an identical prefix (including protocol) as what you are using in your proxy.config serverUrl and what you use in your FeatureLayer url. 

Here is an example:

urlPrefix: http://myserver.com

proxy.config serverUrl: http://myserver.com matchAll='true'

FeatureLayer url: http://myserver.com/arcgis/rest/services/myservice/0

Notice. that the urlPrefix and serverUrl is less specific so that every service from myserver.com will be covered.

Also notice each url is using the same http protocol if you are using https then all need to have that same https protocol in the url.

0 Kudos