How to with Laravel Valet?
-
Has anyone gotten this configured to work on Laravel Valet on MacOS?
Valet runs on an nginx server. I followed instructions from the FAQ.
In
/Users/me/.config/valet/Nginx/
I added amime.types
file. Inside I specifiedtypes { image/webp webp; }
In
/Users/me/.config/valet/Nginx/mysite.test
I added:server { location ~ /wp-content/(?<path>.+)\.(?<ext>jpe?g|png|gif)$ { if ($http_accept !~* "image/webp") { break; } add_header Vary Accept; expires 365d; try_files /wp-content/uploads-webpc/$path.$ext.webp $uri =404; } }
Restarted Valet. The webp resources are still not being added to WordPress’ picture srcset. I don’t have any errors and my images have been transformed into webp, but the webp source files are not showing up in the code.
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘How to with Laravel Valet?’ is closed to new replies.