Plugin Directory

Changeset 2904056


Ignore:
Timestamp:
04/25/2023 06:12:23 PM (3 years ago)
Author:
richarddegoffau
Message:

v2.0.0: nginx support

Location:
fastware-webpavif
Files:
14 added
1 edited

Legend:

Unmodified
Added
Removed
  • fastware-webpavif/trunk/readme.txt

    r2895782 r2904056  
    22Contributors: fastware,richarddegoffau
    33Tags: webp avif convert image google pagespeed
    4 Stable tag: 1.1.4
     4Stable tag: 2.0.0
    55Requires at least: 5.9
    66Tested up to: 6.2
     
    6767==Installation==
    6868
    69 Install & activate the plugin and go!
    70 
    7169= Server requirements =
    7270
    73 - Apache 2.x with mod_rewrite enabled
     71- Apache 2.x with mod_rewrite or Nginx
    7472- ImageMagick or GDlib with WebP support
    75 - PHP max_execution_time of at least 15 seconds
    7673- ImageMagick with AVIF support (optional)
    7774 * You can use this plugin without AVIF support, in that case only WebP conversion is done
    7875
     76= Installation (Apache) =
     77
     78The .htaccess rules are applied automatically when activating the plugin. Install the plugin and go!
     79
     80
     81= Installation (Nginx) =
     82
     83You have to add the following lines to your nginx configuration:
     84In the **http** section (outside the **server** section):
     85
     86    map \$http_accept \$webp {
     87        default ".nonexisting";
     88        "~*image/webp" ".webp";
     89    }
     90
     91    map \$http_accept \$png {
     92        default ".png";
     93        "~*image/webp" "";
     94    }
     95
     96    map \$http_accept \$avif {
     97        default ".nonexisting";
     98        "~*image/avif" ".avif";
     99    }
     100
     101In the **server** section, above the "location /" rule:
     102*(Change the **wp-content** part if this folder is in a non-standard location.)*
     103
     104    location ~* wp\-content/(?!cache/fastware\-webpavif).+\.(jpe?g|png|gif|bmp|webp)\$ {
     105        rewrite /wp\-content/(.+)\$ /wp-content/cache/fastware-webpavif/\$1;
     106    }
     107
     108    location ~* cache/fastware\-webpavif.+\.(jpe?g|png|gif|bmp)\$ {
     109        add_header Vary Accept;
     110        try_files \$uri.pref\$webp \$uri.pref\$avif \$uri\$webp \$uri\$avif \$uri /?fw-webp-avif-ondemand=all;
     111    }
     112
     113    location ~* cache/fastware\-webpavif.+\.webp\$ {
     114        add_header Vary Accept;
     115        try_files \$uri\$png /?fw-webp-avif-ondemand=png;
     116    }
     117
     118In the **mime.types** file, make sure the following lines are present:
     119
     120    image/webp                                       webp;
     121    image/avif                                       avif;
     122
     123
    79124== Changelog ==
    80125
     126= Releases =
     127
     128- 2.0.0 [25-04-2023] Added support for nginx
    81129- 1.1.4 [07-04-2023] Fixed issue with rewriterules test
    82130- 1.1.3 [07-04-2023] Show statistics of converted/queued/skipped images
Note: See TracChangeset for help on using the changeset viewer.