I am facing a challenge with migrating an existing .NET webforms site to work behind Cloudfront as all the webforms are breaking.
Upon further investigation, it has been discovered that the site appears fine, but the webforms are breaking because the
<script src="/WebResource.axd?[...]">
is completely missing. It is not showing a 404 error, but rather the script tag is missing entirely from the HTML response.
It appears that .NET is detecting the browser and generating a customized version of WebResource.axd for that specific browser and page combination.
If there is no match for the browser, then no WebResource.axd file is included.
Even when using
curl http://some-aspnet-webforms-site.example.com/form.aspx
, it is confirmed that WebResource.axd is not being included.
How can I configure Cloudfront to mimic the end-user's browser in order to include WebResource.axd? (Forwarding cookies and query strings does not appear to work, and forwarding all headers seems to cause issues with Cloudfront.)
Alternatively, how can I ensure that .NET always injects/inserts WebResource.axd even if browser sniffing fails?