nginx config not available and Error code: rewrites_not_executed
-
Hello,
Sorry to bother you, but I have installed your plugin to convert images to WebP on two sites. However, it seems that the images have been successfully converted to WebP format in the gallery. But when I check them in the browser, following the instructions, the images still appear in their old size and JPEG format. I believe this issue might be related to Nginx, and I have attempted to configure it for a while without success.
Here is my Nginx configuration file, which is running in a Docker container at
/etc/nginx/conf.d/default.conf
.# nginx.vh.default.conf -- docker-openresty # # This file is installed to: #
/etc/nginx/conf.d/default.conf
# # It tracks theserver
section of the upstream OpenResty'snginx.conf
. # # This config (and any other configs inetc/nginx/conf.d/
) is loaded by # default by theinclude
directive in/usr/local/openresty/nginx/conf/nginx.conf
. # # See https://github.com/openresty/docker-openresty/blob/master/README.md#nginx-config-files # events { # Configure events here } http { server { # BEGIN Converter for Media set $ext_avif ".avif"; if ($http_accept !~* "image/avif") { set $ext_avif ""; } set $ext_webp ".webp"; if ($http_accept !~* "image/webp") { set $ext_webp ""; } location ~ /wp-content/(?<path>.+)\.(?<ext>jpe?g|png|gif|webp)$ { add_header Vary Accept; expires 365d; try_files /wp-content/uploads-webpc/$path.$ext$ext_avif /wp-content/uploads-webpc/$path.$ext$ext_webp $uri =404; } # END Converter for Media listen 80; server_name mydomain.com; #charset koi8-r; #access_log /var/log/nginx/host.access.log main; location / { root /usr/local/openresty/nginx/html; index index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/local/openresty/nginx/html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass https://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root /usr/local/openresty/nginx/html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { deny all; } }Please review and suggest any necessary corrections or modifications. Thank you.
- The topic ‘nginx config not available and Error code: rewrites_not_executed’ is closed to new replies.