• I tried to install this plugin but it does not seem to work.
    Running the latest 5.0.3 WordPress on a NGINX webserver.

    If added the rewrite to my / location:

    
    location / {
        try_files $uri $uri/ /index.php$is_args$args;
        rewrite \.(?:jpe?g|gif|png)$ /wp-content/plugins/adaptive-images/adaptive-images-script.php;
    }    
    

    It seems that the script is not called, because when I add:

    
    error_log('SCRIPT IS CALLED', 3, '/var/www/{sitedir}/wp-content/cache/error.log');
    

    to the adaptive-images-script.php right under the SILENCE test, no error.log is created when I visit a page with images.
    The cache directory remains empty i.e. also no adaptive-images directory is created.

    • This topic was modified 7 years, 4 months ago by kpschaper.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Takis Bouyouris

    (@nevma)

    Hello, my friend,

    Specifically in Nginx the path /wp-content/plugins/adaptive-images/adaptive-images-script.php; might vary depending on your server setup. Unfortunately there is no global solution there. Can you make sure that you have entered the correct path for your setup?

    Also, if you want to quickly test if the plugin is working just add ?debug=true at the end of an image url like this: http://www.domain.com/wp-content/uploads/2019/01/image.jpg?debug=true. The output of such a request should be some debugging text output that explains how the Adaptive Images plugin will handle the image.

    Let me know how it goes!

    Cheers
    Takis

    Thread Starter kpschaper

    (@kpschaper)

    Fixed it myself but thanks for the reply!

    I created the following location to better mirror the apache config:

    
        location ~ /wp-content/(themes|uploads) {
             rewrite \.(?:jpe?g|gif|png)$ /wp-content/plugins/adaptive-images/adaptive-images-script.php;
        }
    
    Plugin Author Takis Bouyouris

    (@nevma)

    Hello, again,

    I am glad you could make things work!

    Now, I am not an NginX expert, so I can’t quite follow why the original configuration

    location / {
        try_files $uri $uri/ /index.php$is_args$args;
        rewrite \.(?:jpe?g|gif|png)$ /wp-content/plugins/adaptive-images/adaptive-images-script.php;
    }

    did not work, but this one did

    location ~ /wp-content/(themes|uploads) {
        rewrite \.(?:jpe?g|gif|png)$ /wp-content/plugins/adaptive-images/adaptive-images-script.php;
    }

    but I will keep this here for future reference for other NginX users.

    Cheers,
    Takis

    Thread Starter kpschaper

    (@kpschaper)

    I don’t see any improvement in the mobile pagespeed insights score, now that the plugin works. (https://developers.google.com/speed/pagespeed/insights/)

    I still get the recommendation to resize the large images and pagespeed reports the unmodified image file sizes?

    Any idea?

    Plugin Author Takis Bouyouris

    (@nevma)

    Hello, my friend,

    Pagespeed is only proposing some general good practices without actually running your website. It reads and analyses your HTML alright, but it is unable to see that, when an image is requested by a smaller device, it will be server transparently in a smaller size. However, Google Analytics will see that the page loads a lot faster and, hopefully, your users will appreciate this and stay on your page more or make more conversions.

    In any case, for real performance testing I recommend a tool like http://webpagetest.org/, one that uses actual devices with actual browsers and under real network conditions.

    Cheers,
    Takis

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Plugin not working (NGINX)’ is closed to new replies.