Want more timely Centmin Mod News Updates?
Become a Member

Nginx Nginx ngx_cache_purge compatibility Fix nginx-1.11.6+

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

  1. bassie

    bassie Active Member

    551
    119
    43
    Apr 29, 2016
    Ratings:
    +364
    Local Time:
    12:58 PM
    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;
     
     
    • Like Like x 1
  2. eva2000

    eva2000 Administrator Staff Member

    30,897
    6,908
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,403
    Local Time:
    9:58 PM
    Nginx 1.13.x
    MariaDB 5.5
    Thanks for heads up ! Centmin Mod 123.09beta01 has been updated with patch :)
     
  3. bassie

    bassie Active Member

    551
    119
    43
    Apr 29, 2016
    Ratings:
    +364
    Local Time:
    12:58 PM
    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.
     
    • Like Like x 1
    • Informative Informative x 1
  4. eva2000

    eva2000 Administrator Staff Member

    30,897
    6,908
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,403
    Local Time:
    9:58 PM
    Nginx 1.13.x
    MariaDB 5.5
    thanks @bassie for heads up testing it out now

     
  5. bassie

    bassie Active Member

    551
    119
    43
    Apr 29, 2016
    Ratings:
    +364
    Local Time:
    12:58 PM
    • Like Like x 2
  6. eva2000

    eva2000 Administrator Staff Member

    30,897
    6,908
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,403
    Local Time:
    9:58 PM
    Nginx 1.13.x
    MariaDB 5.5
    Nice great to see a more frequently updated version of the nginx module :)