Images are being served from CloudFront on a brand new site

My issue

I created a new site today:

I copied a bunch of config from another Netlify site I’ve had running for a long time, including the CSP:

  for = "/*"

    content-security-policy = """\
      default-src 'self'; \
      style-src 'self' 'unsafe-inline'; \
      script-src 'self' 'unsafe-inline'; \
      connect-src; \
      img-src 'self' 'unsafe-inline';

I’m building the site manually and deploying it through the Netlify CLI.

When I look in the generated HTML, the <img> tag has been replaced with a URL pointing at CloudFront:

<img src="">

This causes the images not to load, because that URL isn’t in my CSP.

I would like my images not to be rewritten, so I get a plain link directly to the image on my domain, i.e.

<img src="/notebook.png">

which is how I’m loading images on all my other Netlify sites.

You can see an example of a broken deployment here:

(I’m going to temporarily relax the CSP, so the main URL should soon be fixed, but I think that permanent deployment URL should stay broken?)

Similar issues, all with a common cause?

This isn’t the first time this has happened:

On both occasions Netlify support engineer hrishikesh has come along and fixed the problem, so I’m hoping somebody can do the same here. :crossed_fingers:

Looking further back in the forum, these CloudFront URLs do seem to be related to the now-deprecated Asset Optimization feature. But I created my website earlier today, long after that feature was apparently switched off. Maybe there’s a setting stuck somewhere?

I’ve tried deploying with config that disables Asset Optimization, even though that config is allegedly disabled – no joy, the image URLs are still being rewritten.

Please can somebody from Netlify help me get these URLs fixed on my site?

Should be resolved for you as well.