<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to fix referer with proxy in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-fix-referer-with-proxy/m-p/1234192#M79417</link>
    <description>&lt;P&gt;In the allowedReferers of my proxy.config file, the servers listed don't have the "https://" prefix, so maybe try just "&lt;A href="http://www.mydomain.com/*" target="_blank"&gt;www.mydomain.com/*&lt;/A&gt;"&lt;/P&gt;</description>
    <pubDate>Tue, 22 Nov 2022 17:35:44 GMT</pubDate>
    <dc:creator>JoelBennett</dc:creator>
    <dc:date>2022-11-22T17:35:44Z</dc:date>
    <item>
      <title>How to fix referer with proxy</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-fix-referer-with-proxy/m-p/1234114#M79408</link>
      <description>&lt;P&gt;My website used to work, but now it no longer does. I have a custom web map set up with a proxy and I recently tried to publish it after moving our website to a new server and now it's giving me this error message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;{"error": {"code": 403,"message":"403 - Forbidden: Access is denied.","details":["message":"Current proxy configuration settings do not allow requests which do not include a referer header."]}}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have my proxy code set up like this:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;In the javascript web map file:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;            //Set up the proxy to forward requests for data/geoprocessing tools
            urlUtils.addProxyRule({
                urlPrefix: "https://www.mydomain.com",
                //For production environment (publishing)
                proxyUrl: "/myAppName/proxy/proxy.ashx"
            });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;In my proxy.config file:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;ProxyConfig allowedReferers="https://www.mydomain.com/*"
             mustMatch="true"
             logFile="proxyLog.txt"
             logLevel="Warning"&amp;gt;
	&amp;lt;serverUrls&amp;gt;
		&amp;lt;serverUrl url="https://www.mydomain.com/webadaptor/rest/services/HabitatManagement/HabitatManagement/GPServer"
				   username="username"
				   password="password"
				   matchAll="true"/&amp;gt;
		&amp;lt;serverUrl url="https://www.mydomain.com/webadaptor/rest/services/HabitatMonitoring/HabitatData/MapServer"
				   username="username"
				   password="password"
				   matchAll="true" /&amp;gt;
		&amp;lt;serverUrl url="https://www.mydomain.com/webadaptor/rest/services/HabitatMonitoring/HabitatClassification/GPServer"
				   username="username"
				   password="password"
				   matchAll="true" /&amp;gt;
		&amp;lt;serverUrl url="https://www.mydomain.com/webadaptor/rest/services/PrintHabitatMaps/PrintHabitatMap/GPServer"
				   username="username"
				   password="password"
				   matchAll="true" /&amp;gt;
		&amp;lt;serverUrl url="https://www.mydomain.com/webadaptor/rest/services/ShipData/ShipData/GPServer"
				   username="username"
				   password="password"
				   matchAll="true" /&amp;gt;
		&amp;lt;serverUrl url="https://www.mydomain.com/webadaptor/rest/services/Collector/FieldMapsHbData/GPServer"
				   username="username"
				   password="password"
				   matchAll="true" /&amp;gt;
	&amp;lt;/serverUrls&amp;gt;
&amp;lt;/ProxyConfig&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;This is the request header for one of the map services trying to be reached:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-11-22 095757.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/56567i32E5BF00CA1BD2B5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2022-11-22 095757.png" alt="Screenshot 2022-11-22 095757.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;This is the error info:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-11-22 100344.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/56569i8E37269B1363B3E8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2022-11-22 100344.png" alt="Screenshot 2022-11-22 100344.png" /&gt;&lt;/span&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;The proxyLog.txt file gives me this error. I'm don't really know anything about networks, but I don't understand why it says I have a null referer yet the request header has a value in referer??:&lt;/EM&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;The Proxy is being called by a null referer. Access denied.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2022 15:19:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-fix-referer-with-proxy/m-p/1234114#M79408</guid>
      <dc:creator>MKF62</dc:creator>
      <dc:date>2022-11-22T15:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix referer with proxy</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-fix-referer-with-proxy/m-p/1234128#M79412</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/135504"&gt;@MKF62&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P data-unlink="true"&gt;Does the Referer in your request header https://www.mydomain.com/myAppName/HabitatMap/HabitatJSMap&amp;nbsp;match the one specified in your proxy configuration?&amp;nbsp; It's possible that when you changed webservers the Referer (web address for your application) changed and would need to be updated in your proxy configuration. Do you have an IT department you can reach out to?&amp;nbsp; When it comes to network issues every organizations infrastructure is configured differently and these things can be really hard to troubleshoot without being on site.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2022 15:36:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-fix-referer-with-proxy/m-p/1234128#M79412</guid>
      <dc:creator>Sage_Wall</dc:creator>
      <dc:date>2022-11-22T15:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix referer with proxy</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-fix-referer-with-proxy/m-p/1234150#M79416</link>
      <description>&lt;P&gt;It does match. In my config I use &lt;A href="https://www.mydomain.com/*" target="_blank"&gt;https://www.mydomain.com/*&lt;/A&gt;&lt;/P&gt;&lt;P&gt;So that's all the referrer in the request header needs to match, correct? The asterix at the end should take care of the rest.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2022 16:15:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-fix-referer-with-proxy/m-p/1234150#M79416</guid>
      <dc:creator>MKF62</dc:creator>
      <dc:date>2022-11-22T16:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to fix referer with proxy</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-fix-referer-with-proxy/m-p/1234192#M79417</link>
      <description>&lt;P&gt;In the allowedReferers of my proxy.config file, the servers listed don't have the "https://" prefix, so maybe try just "&lt;A href="http://www.mydomain.com/*" target="_blank"&gt;www.mydomain.com/*&lt;/A&gt;"&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2022 17:35:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-fix-referer-with-proxy/m-p/1234192#M79417</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2022-11-22T17:35:44Z</dc:date>
    </item>
  </channel>
</rss>

