Lukas,
In your JS App add this line:
esri.addProxyRule({urlPrefix: “http://YourWMTSUrl”, proxyUrl:”http://<yourServer>/<pathToProxy>/proxy.ashx” });
You do not need: alwaysUseProxy
Robert,
Sadly it didn't work. It worked for hat WMS-Service, but not for an WMTS Service. Is it possible, that there is a problem with WMTS Services in HTTPS?
Lukas,
It could be an issue with WMTS support in the proxy. I am a bit out of my area now as I never use WMTS services.
Robert,
The proxy is not the problem. The requests are just not send to the proxy. addProxyRule is either not working for WMTS or for HTTPS.
Lukas,
If you believe that it may be a JS API issue then I would call esri tech support.
This remains an outstanding issue with JS API 3.22; we're consuming a secured WMTS service, and need to inject authentication details through the proxy page. Instead, all WMTS requests are routed directly to the URL specified within the ResourceURL element of the GetCapabilities document.