This is how you can easily make Nginx serving webp images if disponible & if browser support it. Informatique Nginx – webp