Support » Plugin: WebP Express » Nginx some Woocommerce images broken

  • LNN

    (@ewan-norman)


    Hi, thanks for this awesome plugin,
    I am on NGINX, the plugin is working fine on home and archive pages, but it doesn’t serve Webp on product pages and some images on Woocommerce products are broken, tried all possible options without any luck, here is the code I used inside the server directive:

    # Redirect all HTTP traffic to HTTPS
    server {
       listen ****;
       listen [::]:*****;
       server_name woodwatchesco.com www.woodwatchesco.com;
       return 301 https://$host$request_uri;
       include /var/www/html/nginx.conf;
      # Rocket-Nginx configuration
      include rocket-nginx/default.conf;
      # WebP Express rules
      # --------------------
      location ~* ^/?wp-content/.*\.(png|jpe?g)$ {
        add_header Vary Accept;
        # expires 365d;
        if ($http_accept !~* "webp"){
          break;
        }
        try_files
          /wp-content/webp-express/webp-images/doc-root/$uri.webp
          $uri.webp
          /wp-content/plugins/webp-express/wod/webp-on-demand.php?xsource=x$request_filename wp-content=wp-content
          ;
      }
      # ------------------- (WebP Express rules ends here)
     }
    

    My settings are as follow:
    https://prnt.sc/oxno80

    Some examples of broken pages:
    https://tinyurl.com/y2pqw538
    https://tinyurl.com/y4xte9mn
    https://tinyurl.com/y6fck8jl

    Thanks for verifying what have I missed here.

    The page I need help with: [log in to see the link]

  • The topic ‘Nginx some Woocommerce images broken’ is closed to new replies.