• Resolved mathias

    (@mobiledigs)


    Hi,

    I got a Problem with nginx. The Folder won’t created and no images where cached.

    Debug Info:

    ? PHP GD library is installed.
    ? Image cache directory has not been created.
    But this is probably because the cache has not been accessed yet. 
    After accessing your website from a mobile device the directory should be automatically created.
    
    /var/sites/studierenplus/wp-content/cache => drwxr-xr-x
    ? Installation .htaccess file is setup OK.
    /var/sites/studierenplus/.htaccess => -rw-r--r--
    ? Adaptive images settings dump:
    array(14) {
      ["resolutions"]=>
      array(3) {
        [0]=>
        int(1024)
        [1]=>
        int(640)
        [2]=>
        int(480)
      }
      ["hidpi"]=>
      bool(true)
      ["cache-directory"]=>
      string(21) "cache/adaptive-images"
      ["watched-directories"]=>
      array(2) {
        [0]=>
        string(18) "wp-content/uploads"
        [1]=>
        string(17) "wp-content/themes"
      }
      ["jpeg-quality"]=>
      int(75)
      ["sharpen-images"]=>
      bool(true)
      ["watch-cache"]=>
      bool(true)
      ["browser-cache"]=>
      float(180)
      ["landscape"]=>
      bool(false)
      ["cdn-support"]=>
      bool(false)
      ["version"]=>
      string(6) "0.6.62"
      ["sanitized"]=>
      bool(true)
      ["wp-content-dir"]=>
      string(35) "/var/sites/studierenplus/wp-content"
      ["wp-content-url"]=>
      string(39) "https://www.studierenplus.de/wp-content"
    }

    System Informations:

    Web Server	
    nginx/1.10.0
    Document Root	
    /var/sites/studierenplus
    PHP	
    7.0.15-0ubuntu0.16.04.4
    PHP Time Limit	
    300
    PHP Memory Limit	
    1024M
    PHP Post Max Size	
    96M
    PHP Upload Max Size	
    96M
    PHP Max Input Vars	
    1000
    PHP Display Errors	
    Yes
    PHP Error Log	
    MySQL	
    5.5.5-10.0.29-MariaDB-0ubuntu0.16.04.1
    MySQL Ext/mysqli	
    Yes
    MySQL Table Prefix	
    wp_
    MySQL DB Charset	
    utf8
    WP	
    4.7.4
    WP Multisite	
    No
    WP Debug Mode	
    No
    WP Site url	
    https://www.studierenplus.de
    WP WP Home url	
    https://www.studierenplus.de
    WP Permalinks	
    /%postname%/
    WP home path	
    /var/sites/studierenplus/
    WP content dir	
    /var/sites/studierenplus/wp-content
    WP plugin dir	
    /var/sites/studierenplus/wp-content/plugins
    WP content url	
    https://www.studierenplus.de/wp-content
    WP plugin url	
    https://www.studierenplus.de/wp-content/plugins
    WP Locale	
    de_DE
    WP Memory Limit	
    256M
    WP Max Upload Size	
    96mb
    WP Active plugins	
    Adaptive Images for WordPress v.0.6.62 by Nevma
    AddToAny Share Buttons v.1.7.9 by AddToAny
    Website Tools by AddThis v.3.0.0 by The AddThis Team
    Follow Buttons by AddThis v.4.0.0 by The AddThis Team
    Share Buttons by AddThis v.5.3.5 by The AddThis Team
    WP-All-Image-Sizes v.0.2 by Salvatore Fresta
    Antispam Bee v.2.7.1 by pluginkollektiv
    bananacontent v.2.1.3 by Vladislav Melnik, Jonas Breuer
    Checkout Address Autocomplete for WooCommerce v.1.3 by eCreations
    Conditional Menus v.1.0.6 by Themify
    Cookie Notice v.1.2.38 by dFactory
    Delete Me v.2.0 by Clinton Caldwell
    EWWW Image Optimizer v.3.3.0 by Shane Bishop
    Formidable Bootstrap v.1.02 by Strategy11
    Formidable Forms v.2.03.07 by Strategy11
    Google Analytics Dashboard für WP v.4.9.6.2 by Alin Marcu
    KingSumo Giveaways v.1.5.1 by KingSumo
    Loco Translate v.2.0.13 by Tim Whitlock
    Nginx Zwischenspeicher v.1.0.2 by Till Krüss
    Password Strength for WooCommerce v.1.0.1 by Potent Plugins
    PHP Code For Posts v.2.2.2.1 by Jamie Fraser
    Pretty Link v.2.0.8 by Blair Williams
    Reading Position Indicator v.1.0.1 by Marcin Pietrzak
    Search Exclude v.1.2.2 by Roman Pronskiy
    WooCommerce Send Emails v.1.3 by Stuart O'Brien, cxThemes
    Share a Draft v.1.4 by Nikolay Bachiyski
    Thrive Clever Widgets v.1.27 by Thrive Themes
    Thrive Leads v.1.95.17 by Thrive Themes
    Thrive Ovation v.1.0.13 by Thrive Themes
    Thrive Quiz Builder v.1.0.10 by Thrive Themes
    Thrive Visual Editor v.1.500.16 by Thrive Themes
    Woo Checkout Field Editor Pro v.1.1.6 by ThemeHiGH
    WooCommerce - Autocomplete Orders v.1.1.4 by Serious Plugins
    WooCommerce Stripe Gateway v.3.1.7 by WooCommerce
    German Market v.3.2.3 by MarketPress
    WooCommerce Mitglieder v.1.8.3 by SkyVerge
    WooCommerce Name Your Price v.2.5.3 by Kathy Darling
    WooCommerce Social Login v.2.1.0 by SkyVerge
    WooCommerce Subscription Downloads v.1.1.6 by WooCommerce
    WooCommerce Subscriptions v.2.2.5 by Prospress Inc.
    WooCommerce v.3.0.4 by Automattic
    WooCommerce Helper v.1.7.2 by WooCommerce
    Yoast SEO v.4.6 by Team Yoast
    WordPress Anti-Clone v.0.1.2 by Sebastian Bauer
    WP LikeJS v.1.0.1 by Dennis Niedernh?fer und Merlin Roth
    WP Speed of Light v.1.3.0 by JoomUnited
    WP MU plugins

    And the nginx config:

    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
        expires 30d;
        access_log on;
        rewrite_log on;
        rewrite \.(?:jpe?g|gif|png)$ /wp-content/plugins/adaptive-images/adaptive-images-script.php;
    }

    Greetings

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Takis Bouyouris

    (@nevma)

    Hello, my friend,

    Thank you very much for the comprehensive info!

    Your general configuration seems OK, but there must be something wrong with the NginX location directive. It seems that the requests for images are not redirected to the script of our plugin. You can confirm this by hitting an image url like this https://www.studierenplus.de/wp-content/uploads/2017/04/bafoeg-online-300×300.png?debug=true (note the “?debug=true” at the end). If the plugin was working, then this url would produce some debug text output, but it doesn’t.

    If all else is OK, I believe that all you need to do is find the correct syntax combination for the location directive in your NginX setup.

    Maybe you need to have a separate

    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
        rewrite \.(?:jpe?g|gif|png)$ /wp-content/plugins/adaptive-images/adaptive-images-script.php;
    }

    instead of a combined one. I am sorry I cannot be 100% sure about this, because I am not an NginX expert. But I think that either this or some path variation is the problem here.

    Let me know how it goes!

    Cheers,
    Takis

    Thread Starter mathias

    (@mobiledigs)

    Hi Takis,

    I tried this before with debug=true…

    But after your mention, I checked all location and found in my config this include /etc/nginx/expires.conf;

    There is a addition config for my images like:

    # Media: images, icons, video, audio, HTC
    	location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
      		expires 1M;
      		#access_log off;
      		add_header Cache-Control "public";
      		add_header Cache-Control "immutable";
      		rewrite \.(?:jpe?g|gif|png)$ /wp-content/plugins/adaptive-images/adaptive-images-script.php;
    	}

    After adding the rewrite rule, it works perfect.

    Thank you ?? for your help!

    Mat

    Plugin Author Takis Bouyouris

    (@nevma)

    Oh, that’s great news! I knew that NginX provides a different flexibility than Apache, so simply giving the code for it would not be enough. One needs to know exactly where to place it.

    Cheers,
    Takis

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Folder won’t created. NGINX’ is closed to new replies.