Could someone point in the right direction as to why the proxy duplicate the url:
https://localhost/proxy/proxy.ashx?https://localhost/proxy/proxy.ashx?https://services.arcgisonline.com/ArcGIS/rest/serv…
This is my proxy.ashx
<?xml version="1.0" encoding="utf-8" ?>
<ProxyConfig allowedReferers="*" logFile="proxylog.txt"
mustMatch="false">
<serverUrls>
<serverUrl url="https://services.arcgisonline.com"
matchAll="true"/>
<serverUrl url="https://server.arcgisonline.com"
</serverUrls>
</ProxyConfig>
For others that might have the same problem. I solved it but not sure if it's best practice.
esriConfig.defaults.io.proxyUrl //removed
esriConfig.defaults.io.alwaysUseProxy = false;
urlUtils.addProxyRule({
proxyUrl: "https://xyz/proxy/proxy.ashx",
urlPrefix: "https://xyz/arcgis/rest/services/xyz/xyz/MapServer",
accessToken: "1xxxxxxxxxxxxxxasdfasdfasdfasdfasdfasdfasdfasdf"
});
Generated my own token based on some kind folks here: Login prompt appearing randomly · Issue #300 · Esri/resource-proxy · GitHub
Robert,
No, I'm not manually appending anything. When I turn off "alwaysUseProxy", I get the login form even though I have "urlUtils.addProxyRule." I'll change localhost to machine name and see if that helps.
Thanks for your input.
Khanh,
You are not manually appending the proxy.ashx to any of your url strings in your code are you?
Some advice, I never use localhost. I always use my machine name (i.e. gislap183). There is probably no reason to use "alwaysUseProxy" as true. You only want to proxy urls that require proxy'ing.
Of course...viewer.js
Can we see where you define the esriConfig.defaults.io.proxyUrl portion in your code?
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.