Want to subscribe to topics you're interested in?
Become a Member

Nginx Nginx ngx_cache_purge compatibility Fix nginx-1.11.6+

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by buik, May 4, 2017.

  1. buik

    buik “The best traveler is one without a camera.”

    2,027
    524
    113
    Apr 29, 2016
    Flanders
    Ratings:
    +1,675
    Local Time:
    10:59 AM
    As Centminmod is using ngx_cache_purge.
    There seems to be a problem with Nginx 1.11.6 and above in association with
    Nginx ngx_cache_purge.
    This patch repairs the compatibility issues.

    Fix compatibility with nginx-1.11.6+ by psulowicz · Pull Request #51 · FRiCKLE/ngx_cache_purge · GitHub


    Code:
    From c7345057ad5429617fc0823e92e3fa8043840cef Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Su=C5=82owicz=20Pawe=C5=82?= <Pawel.Sulowicz@grupaonet.pl>
    Date: Thu, 2 Feb 2017 09:39:37 +0100
    Subject: [PATCH] Fix compatibility with nginx-1.11.6+
    
    ---
     ngx_cache_purge_module.c | 4 ++++
     1 file changed, 4 insertions(+)
    
    diff --git a/ngx_cache_purge_module.c b/ngx_cache_purge_module.c
    index 62d3818..fd1ebde 100644
    --- a/ngx_cache_purge_module.c
    +++ b/ngx_cache_purge_module.c
    @@ -492,7 +492,11 @@ typedef struct {
         ngx_str_t                      body_source;
     #  endif /* nginx_version < 1007008 */
     
    +#  if (nginx_version >= 1011006)
    +    ngx_http_complex_value_t      *method;
    +#  else
         ngx_str_t                      method;
    +#  endif /* nginx_version >= 1011006 */
         ngx_str_t                      location;
         ngx_str_t                      url;
     
     
  2. eva2000

    eva2000 Administrator Staff Member

    54,894
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    7:59 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Thanks for heads up ! Centmin Mod 123.09beta01 has been updated with patch :)
     
  3. buik

    buik “The best traveler is one without a camera.”

    2,027
    524
    113
    Apr 29, 2016
    Flanders
    Ratings:
    +1,675
    Local Time:
    10:59 AM
    Ngx_cache_purge is old, not maintained any more for a long, long time,
    and not working correctly with the latest Nginx without patch.

    I think it's a good idea to switch to:
    https://github.com/nginx-modules/ngx_cache_purge

    It is a branch copy, maintained with bug fixes and patches and works out of the box with the latest Nginx version.
     
  4. eva2000

    eva2000 Administrator Staff Member

    54,894
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    7:59 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    thanks @bassie for heads up testing it out now

     
  5. buik

    buik “The best traveler is one without a camera.”

    2,027
    524
    113
    Apr 29, 2016
    Flanders
    Ratings:
    +1,675
    Local Time:
    10:59 AM
  6. eva2000

    eva2000 Administrator Staff Member

    54,894
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    7:59 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Nice great to see a more frequently updated version of the nginx module :)