Search code examples
nginxproxyrequesthttp2webp

Opening a web page makes two identical requests, but the second one with "Accept: image/webp,*/*" header


I have an nginx proxy node and an nginx upstream node. When I open the page in a browser, the original request is then duplicated but uses a different Accept: image/webp,*/* header.

It's running behind Cloudflare proxy with Development mode ON so this should make no difference. I don't see any reason why it's doing it.

First request: Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Second request: Accept: image/webp,*/*

Please see highlighted rows on the screenshot.

Accept: image/webp,*/*


Solution

  • At your page source you have this:

    <div class="logo-this-pub" style="background-image: url('')">
    

    This is exactly the cause of this request. As I could see you're using a WordPress. Usually it is a result of some shortcode rendering where an id of non-existent WordPress media library element is used (this could occur when you use media library element while composing the page and delete it later). So you need to check what shortcode is rendered to this HTML code and fix it.