• Resolved Cicciokr

    (@cicciokr)


    Hi, i have seen about htaccess configuration to add for the plugin, but on my server i have nginx, some can tell me the configuration about it?

    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Cicciokr

    (@cicciokr)

    This is my nginx configuration file modified:

    if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
    	set $cache_uri 'null cache';
    }
    
    # Don't use the cache for logged in users or recent commenters
    if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") {
    	set $cache_uri 'null cache';
    }
    
    location ~ (?<root>.+)/uploads/(?<path>.+)\.(?<ext>jp?g|png|gif)$ {
    	if ($http_accept !~* "image/webp") {
    		break;
    	}
    	add_header Vary Accept;
    	expires 365d;
    	try_files $root/uploads-webpc/$path.$ext.webp $uri =404;
    }
    
    # Use cached or actual file if they exists, otherwise pass request to WordPress
    location ~ / {
    	try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php ;
    }
    
    # WORDPRESS PERMALINKS
    if (!-e $request_filename) {
    	rewrite ^(.+)$ /index.php?q=$1 last;
    }
    
    Thread Starter Cicciokr

    (@cicciokr)

    Sorry the problem was “Browser caching”, that not load new image.

    Thank you for this plugin!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Nginx configuration’ is closed to new replies.