Title: Plugin not working (NGINX)
Last modified: January 19, 2019

---

# Plugin not working (NGINX)

 *  [kpschaper](https://wordpress.org/support/users/kpschaper/)
 * (@kpschaper)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/plugin-not-working-nginx/)
 * 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](https://wordpress.org/support/users/kpschaper/).

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

 *  Plugin Author [Takis Bouyouris](https://wordpress.org/support/users/nevma/)
 * (@nevma)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/plugin-not-working-nginx/#post-11108538)
 * 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
    -  This reply was modified 7 years, 4 months ago by [Takis Bouyouris](https://wordpress.org/support/users/nevma/).
 *  Thread Starter [kpschaper](https://wordpress.org/support/users/kpschaper/)
 * (@kpschaper)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/plugin-not-working-nginx/#post-11108549)
 * 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](https://wordpress.org/support/users/nevma/)
 * (@nevma)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/plugin-not-working-nginx/#post-11109689)
 * 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](https://wordpress.org/support/users/kpschaper/)
 * (@kpschaper)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/plugin-not-working-nginx/#post-11109709)
 * I don’t see any improvement in the mobile pagespeed insights score, now that 
   the plugin works. ([https://developers.google.com/speed/pagespeed/insights/](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](https://wordpress.org/support/users/nevma/)
 * (@nevma)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/plugin-not-working-nginx/#post-11109981)
 * 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/](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.

 * ![](https://ps.w.org/adaptive-images/assets/icon-256x256.png?rev=1138642)
 * [Adaptive Images for WordPress](https://wordpress.org/plugins/adaptive-images/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/adaptive-images/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/adaptive-images/)
 * [Active Topics](https://wordpress.org/support/plugin/adaptive-images/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/adaptive-images/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/adaptive-images/reviews/)

## Tags

 * [nginx](https://wordpress.org/support/topic-tag/nginx/)

 * 5 replies
 * 2 participants
 * Last reply from: [Takis Bouyouris](https://wordpress.org/support/users/nevma/)
 * Last activity: [7 years, 4 months ago](https://wordpress.org/support/topic/plugin-not-working-nginx/#post-11109981)
 * Status: not resolved