nginx
On nginx the plugin cannot write the server configuration for you. Most sites do not need to touch it at all.
The default needs nothing
The default delivery method, the picture tag, rewrites the page so each image offers its WebP and AVIF copies with the original as the last fallback. It works on any server, nginx included, and with any CDN.
Server rules, if you want them
Server rules serve the modern file at the original image URL, chosen from the browser’s Accept header. They are faster still and also cover images the plugin never sees, such as CSS backgrounds. Paste this into the server block, before the generic location rules, then reload nginx. The plugin’s Settings screen shows the same snippet with your uploads path.
map $http_accept $wao_avif { default ""; "~*image/avif" ".avif"; }
map $http_accept $wao_webp { default ""; "~*image/webp" ".webp"; }
location ~* ^/wp-content/uploads/.+\.(jpe?g|png|gif)$ {
add_header Vary Accept;
try_files $uri$wao_avif $uri$wao_webp $uri =404;
}
The two map lines belong in the http context; if your configuration only lets you edit the server block, put them in a file under conf.d/.
Older nginx versions do not know the AVIF type. If mime.types has no avif line, add image/avif avif; to it, otherwise AVIF files go out with a generic type that browsers refuse.
Check it
Switch the delivery to web server rules in Settings, then press Check my site on the dashboard, or run wp webp-avif check. It reports whether the rules are applied, whether the right content type comes back and whether Vary: Accept is present.
Private Space and nginx caches
Members-only pages and pages using the Private Space shortcodes send no-cache headers and set DONOTCACHEPAGE. If you run nginx’s FastCGI cache, make sure it honours Cache-Control or skips signed-in users, as any WordPress setup with accounts should.