Select to view content in your preferred language

Proxy question - VS2015 testing - localhost:xxxx

1578
4
12-02-2017 03:20 AM
AdrianMarsden
Honored Contributor

Hi


We've moved on and we now are encouraged to use VS correctly, with Source Control and local testing before it goes anywhere near a server

Alas, my knowledge of VS in the modern world is lacking.  As when I try to browse my site from VS, it goes to a localhot:1234 addresses and the proxy just fails to work at all, I get 

"Unable to load /proxy/proxy.ashx?http://<server name>/arcgis/rest/services/LIVEinternal/aerials/MapServer?

f=json&dpi=96&transparent=true&format=png8 status: 500"

With this as more info when I try to go direct to the URL

The request was aborted: Could not create SSL/TLS secure channel.

I've tried various changes to the proxy config, but just can't find the magic combination.


Currently it is

<ProxyConfig allowedReferers="*"
 mustMatch="true">
 <serverUrls>
 <serverUrl url="http://<server name>/arcgis/"
 username="webmap"
 password="password"
 matchAll="true"/>
 <serverUrl url="https://<server name>/arcgis/"
 username="webmap"
 password="password"
 matchAll="true"/>
 </serverUrls>
</ProxyConfig>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

I would ideally like to get shot of the proxy, but the print service fails in IE11 without it 😞

Testing the proxy page with

http://localhost:62146/proxy/proxy.ashx?ping 

gives

{ "Proxy Version": "1.1.2", "Configuration File": "OK", "Log File": "Not Exist/Readable"}

So I think that is OK.

Changing the allowedRefeerers to http:\<servername> changes the error from a 500 to a 403

And the full error is

{"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: http://<server name>/arcgis/rest/services/BaseMapOSNonTiled/MapServer?f=json&dpi=96&transparent=true&format=png8 http://<server name>/arcgis/rest/services/BaseMapOSNonTiled/MapServer?f=json&dpi=96&transparent=true&format=png8"}}‍‍‍

I also can't get my head around this is in the config

  • 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.

To me that is contradictory, the first bullet says you need matchAll to be false where you just have the root, the second bullet seems to contradict that"

Confused!

Cheers


ACM

0 Kudos
4 Replies
AdrianMarsden
Honored Contributor

More info, changing the Proxy config from 

        <serverUrl url="http://server name"

To 

        <serverUrl url="http://server name/arcgis/rest/services/LIVEinternal/aerials/MapServer"

moves the error from a 403 to the 

Server Error in '/' Application.


The request was aborted: Could not create SSL/TLS secure channel.

erorr - which to me looks like something is missing in the way I am testing the site in VS

0 Kudos
AdrianMarsden
Honored Contributor

Edit #2

Sorted it (I think)  it wasn't happy I had a user name and password in the config (these services don't need them) - I may still have an issue when I come to services that DO need them.  Odd.

0 Kudos
ChenChen3
Emerging Contributor

Hey Adrian,

I have the same issue, have you got it fixed? 

Cheers,

Chen

0 Kudos
AdrianMarsden
Honored Contributor

Yes - as I said - it didn't seem to like me having user credentials in the proxy config - luckilly I don't need them at the moment, taking them out made everything work

0 Kudos