nginx-modules / ngx_cache_purge

nginx module which support to purge ngx_http_(fastcgi|proxy|scgi|uwsgi)_module cache backend
Other
209 stars 34 forks source link

Got 'Empty reply from server' while trying to PURGE cache. #1

Closed Altimit closed 7 years ago

Altimit commented 7 years ago

Everything worked fine with nginx_1.11.1 + FRiCKLE/ngx_cache_purge bundle. Then, in order to implement APLN for http2 support, I recompiled nginx with openssl-1.1.0c and nginx-modules/ngx_cache_purge. After that I started getting Empty reply from server on my purge cache requests.

# curl -X PURGE http://127.0.0.1/test
curl: (52) Empty reply from server

nginx -V:

nginx version: nginx/1.11.6
built by gcc 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04) 
built with OpenSSL 1.1.0c  10 Nov 2016
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now' --with-openssl=/home/wizard/dist/openssl/openssl-1.1.0c --add-dynamic-module=/home/wizard/dist/ngx_cache_purge

nginx -T configuration file /etc/nginx/nginx.conf:

user  nginx;
worker_processes  1;

load_module "modules/ngx_http_cache_purge_module.so";

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;
    error_log  /var/log/nginx/error.log  debug;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;
}

# configuration file /etc/nginx/mime.types:

types {
    text/html                             html htm shtml;
    text/css                              css;
    text/xml                              xml;
    image/gif                             gif;
    image/jpeg                            jpeg jpg;
    application/javascript                js;
    application/atom+xml                  atom;
    application/rss+xml                   rss;

    text/mathml                           mml;
    text/plain                            txt;
    text/vnd.sun.j2me.app-descriptor      jad;
    text/vnd.wap.wml                      wml;
    text/x-component                      htc;

    image/png                             png;
    image/tiff                            tif tiff;
    image/vnd.wap.wbmp                    wbmp;
    image/x-icon                          ico;
    image/x-jng                           jng;
    image/x-ms-bmp                        bmp;
    image/svg+xml                         svg svgz;
    image/webp                            webp;

    application/font-woff                 woff;
    application/java-archive              jar war ear;
    application/json                      json;
    application/mac-binhex40              hqx;
    application/msword                    doc;
    application/pdf                       pdf;
    application/postscript                ps eps ai;
    application/rtf                       rtf;
    application/vnd.apple.mpegurl         m3u8;
    application/vnd.ms-excel              xls;
    application/vnd.ms-fontobject         eot;
    application/vnd.ms-powerpoint         ppt;
    application/vnd.wap.wmlc              wmlc;
    application/vnd.google-earth.kml+xml  kml;
    application/vnd.google-earth.kmz      kmz;
    application/x-7z-compressed           7z;
    application/x-cocoa                   cco;
    application/x-java-archive-diff       jardiff;
    application/x-java-jnlp-file          jnlp;
    application/x-makeself                run;
    application/x-perl                    pl pm;
    application/x-pilot                   prc pdb;
    application/x-rar-compressed          rar;
    application/x-redhat-package-manager  rpm;
    application/x-sea                     sea;
    application/x-shockwave-flash         swf;
    application/x-stuffit                 sit;
    application/x-tcl                     tcl tk;
    application/x-x509-ca-cert            der pem crt;
    application/x-xpinstall               xpi;
    application/xhtml+xml                 xhtml;
    application/xspf+xml                  xspf;
    application/zip                       zip;

    application/octet-stream              bin exe dll;
    application/octet-stream              deb;
    application/octet-stream              dmg;
    application/octet-stream              iso img;
    application/octet-stream              msi msp msm;

    application/vnd.openxmlformats-officedocument.wordprocessingml.document    docx;
    application/vnd.openxmlformats-officedocument.spreadsheetml.sheet          xlsx;
    application/vnd.openxmlformats-officedocument.presentationml.presentation  pptx;

    audio/midi                            mid midi kar;
    audio/mpeg                            mp3;
    audio/ogg                             ogg;
    audio/x-m4a                           m4a;
    audio/x-realaudio                     ra;

    video/3gpp                            3gpp 3gp;
    video/mp2t                            ts;
    video/mp4                             mp4;
    video/mpeg                            mpeg mpg;
    video/quicktime                       mov;
    video/webm                            webm;
    video/x-flv                           flv;
    video/x-m4v                           m4v;
    video/x-mng                           mng;
    video/x-ms-asf                        asx asf;
    video/x-ms-wmv                        wmv;
    video/x-msvideo                       avi;
}

# configuration file /etc/nginx/conf.d/default.conf:
proxy_cache_path /data/nginx/img_cache levels=1:2 keys_zone=img_cache:10m max_size=100m inactive=90d;

server {
    listen       80;
    server_name  localhost;

    resolver 8.8.8.8 ipv6=off;

    #charset koi8-r;
    #access_log  /var/log/nginx/log/host.access.log  main;

    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
    }

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    location /test {
        proxy_intercept_errors on;

        proxy_cache img_cache;
        proxy_cache_key $uri;

        proxy_cache_lock on;
        proxy_cache_lock_timeout 3s;
        proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
        proxy_ignore_headers "Set-Cookie";
        proxy_cache_valid 90d;

        proxy_cache_purge PURGE from all;

        proxy_pass http://nginx.org/nginx.png;
    }

    location /purge {
        proxy_cache_purge img_cache /test;
    }

}

Debug log:


2016/12/12 13:40:12 [debug] 31487#31487: accept on 0.0.0.0:80, ready: 0
2016/12/12 13:40:12 [debug] 31487#31487: posix_memalign: 0000000000E27B30:512 @16
2016/12/12 13:40:12 [debug] 31487#31487: *2 accept: 127.0.0.1:32966 fd:12
2016/12/12 13:40:12 [debug] 31487#31487: *2 event timer add: 12: 60000:1481550072300
2016/12/12 13:40:12 [debug] 31487#31487: *2 reusable connection: 1
2016/12/12 13:40:12 [debug] 31487#31487: *2 epoll add event: fd:12 op:1 ev:80002001
2016/12/12 13:40:12 [debug] 31487#31487: *2 http wait request handler
2016/12/12 13:40:12 [debug] 31487#31487: *2 malloc: 0000000000E27D40:1024
2016/12/12 13:40:12 [debug] 31487#31487: *2 recv: eof:0, avail:1
2016/12/12 13:40:12 [debug] 31487#31487: *2 recv: fd:12 79 of 1024
2016/12/12 13:40:12 [debug] 31487#31487: *2 reusable connection: 0
2016/12/12 13:40:12 [debug] 31487#31487: *2 posix_memalign: 0000000000E17D00:4096 @16
2016/12/12 13:40:12 [debug] 31487#31487: *2 http process request line
2016/12/12 13:40:12 [debug] 31487#31487: *2 http request line: "PURGE /test HTTP/1.1"
2016/12/12 13:40:12 [debug] 31487#31487: *2 http uri: "/test"
2016/12/12 13:40:12 [debug] 31487#31487: *2 http args: ""
2016/12/12 13:40:12 [debug] 31487#31487: *2 http exten: ""
2016/12/12 13:40:12 [debug] 31487#31487: *2 http process request header line
2016/12/12 13:40:12 [debug] 31487#31487: *2 http header: "User-Agent: curl/7.35.0"
2016/12/12 13:40:12 [debug] 31487#31487: *2 http header: "Host: 127.0.0.1"
2016/12/12 13:40:12 [debug] 31487#31487: *2 http header: "Accept: */*"
2016/12/12 13:40:12 [debug] 31487#31487: *2 http header done
2016/12/12 13:40:12 [debug] 31487#31487: *2 event timer del: 12: 1481550072300
2016/12/12 13:40:12 [debug] 31487#31487: *2 generic phase: 0
2016/12/12 13:40:12 [debug] 31487#31487: *2 rewrite phase: 1
2016/12/12 13:40:12 [debug] 31487#31487: *2 test location: "/"
2016/12/12 13:40:12 [debug] 31487#31487: *2 test location: "purge"
2016/12/12 13:40:12 [debug] 31487#31487: *2 test location: "test"
2016/12/12 13:40:12 [debug] 31487#31487: *2 using configuration "/test"
2016/12/12 13:40:12 [debug] 31487#31487: *2 http cl:-1 max:1048576
2016/12/12 13:40:12 [debug] 31487#31487: *2 rewrite phase: 3
2016/12/12 13:40:12 [debug] 31487#31487: *2 post rewrite phase: 4
2016/12/12 13:40:12 [debug] 31487#31487: *2 generic phase: 5
2016/12/12 13:40:12 [debug] 31487#31487: *2 generic phase: 6
2016/12/12 13:40:12 [debug] 31487#31487: *2 generic phase: 7
2016/12/12 13:40:12 [debug] 31487#31487: *2 access phase: 8
2016/12/12 13:40:12 [debug] 31487#31487: *2 access phase: 9
2016/12/12 13:40:12 [debug] 31487#31487: *2 access phase: 10
2016/12/12 13:40:12 [debug] 31487#31487: *2 post access phase: 11
2016/12/12 13:40:12 [debug] 31487#31487: *2 posix_memalign: 0000000000E0A140:4096 @16
2016/12/12 13:40:12 [debug] 31487#31487: *2 http set discard body
2016/12/12 13:40:12 [alert] 31485#31485: worker process 31487 exited on signal 11 (core dumped)
2016/12/12 13:40:12 [debug] 31496#31496: epoll add event: fd:6 op:1 ev:00002001
denji commented 7 years ago

I will look in the week, the problem probably is in b6dace3 or d20b712.

denji commented 7 years ago

@Altimit You can try, was reverted b6dace3 and d20b712 commit:

git clone -b testing https://github.com/nginx-modules/ngx_cache_purge.git
Altimit commented 7 years ago

Same thing here.

Altimit commented 7 years ago

debug.log:

2016/12/14 12:01:34 [debug] 12672#12672: accept on 0.0.0.0:80, ready: 0
2016/12/14 12:01:34 [debug] 12672#12672: posix_memalign: 00000000026D6C10:512 @16
2016/12/14 12:01:34 [debug] 12672#12672: *32 accept: 127.0.0.1:44640 fd:14
2016/12/14 12:01:34 [debug] 12672#12672: *32 event timer add: 14: 60000:1481716954850
2016/12/14 12:01:34 [debug] 12672#12672: *32 reusable connection: 1
2016/12/14 12:01:34 [debug] 12672#12672: *32 epoll add event: fd:14 op:1 ev:80002001
2016/12/14 12:01:34 [debug] 12672#12672: *32 http wait request handler
2016/12/14 12:01:34 [debug] 12672#12672: *32 malloc: 00000000026D6E20:1024
2016/12/14 12:01:34 [debug] 12672#12672: *32 recv: eof:0, avail:1
2016/12/14 12:01:34 [debug] 12672#12672: *32 recv: fd:14 79 of 1024
2016/12/14 12:01:34 [debug] 12672#12672: *32 reusable connection: 0
2016/12/14 12:01:34 [debug] 12672#12672: *32 posix_memalign: 000000000270FAC0:4096 @16
2016/12/14 12:01:34 [debug] 12672#12672: *32 http process request line
2016/12/14 12:01:34 [debug] 12672#12672: *32 http request line: "PURGE /test HTTP/1.1"
2016/12/14 12:01:34 [debug] 12672#12672: *32 http uri: "/test"
2016/12/14 12:01:34 [debug] 12672#12672: *32 http args: ""
2016/12/14 12:01:34 [debug] 12672#12672: *32 http exten: ""
2016/12/14 12:01:34 [debug] 12672#12672: *32 http process request header line
2016/12/14 12:01:34 [debug] 12672#12672: *32 http header: "User-Agent: curl/7.35.0"
2016/12/14 12:01:34 [debug] 12672#12672: *32 http header: "Host: localhost"
2016/12/14 12:01:34 [debug] 12672#12672: *32 http header: "Accept: */*"
2016/12/14 12:01:34 [debug] 12672#12672: *32 http header done
2016/12/14 12:01:34 [debug] 12672#12672: *32 event timer del: 14: 1481716954850
2016/12/14 12:01:34 [debug] 12672#12672: *32 generic phase: 0
2016/12/14 12:01:34 [debug] 12672#12672: *32 rewrite phase: 1
2016/12/14 12:01:34 [debug] 12672#12672: *32 test location: "/"
2016/12/14 12:01:34 [debug] 12672#12672: *32 test location: "purge"
2016/12/14 12:01:34 [debug] 12672#12672: *32 test location: "test"
2016/12/14 12:01:34 [debug] 12672#12672: *32 using configuration "/test"
2016/12/14 12:01:34 [debug] 12672#12672: *32 http cl:-1 max:1048576
2016/12/14 12:01:34 [debug] 12672#12672: *32 rewrite phase: 3
2016/12/14 12:01:34 [debug] 12672#12672: *32 post rewrite phase: 4
2016/12/14 12:01:34 [debug] 12672#12672: *32 generic phase: 5
2016/12/14 12:01:34 [debug] 12672#12672: *32 generic phase: 6
2016/12/14 12:01:34 [debug] 12672#12672: *32 generic phase: 7
2016/12/14 12:01:34 [debug] 12672#12672: *32 access phase: 8
2016/12/14 12:01:34 [debug] 12672#12672: *32 access phase: 9
2016/12/14 12:01:34 [debug] 12672#12672: *32 access phase: 10
2016/12/14 12:01:34 [debug] 12672#12672: *32 post access phase: 11
2016/12/14 12:01:34 [debug] 12672#12672: *32 posix_memalign: 00000000026EB020:4096 @16
2016/12/14 12:01:34 [debug] 12672#12672: *32 http set discard body
2016/12/14 12:01:34 [alert] 12574#12574: worker process 12672 exited on signal 11 (core dumped)
2016/12/14 12:01:34 [debug] 12676#12676: epoll add event: fd:6 op:1 ev:00002001

In the same time purging via curl -XGET http://localhost/purge works well.

<html>
<head><title>Successful purge</title></head>
<body bgcolor="white">
<center><h1>Successful purge</h1>
<br>Key : /test
<br>Path: /data/nginx/img_cache/9/ac/4539330648b80f94ef3bf911f6d77ac9
</center>
<hr><center>nginx/1.11.6</center>
</body>
</html>

debug-log:

2016/12/14 12:03:55 [debug] 12676#12676: accept on 0.0.0.0:80, ready: 0
2016/12/14 12:03:55 [debug] 12676#12676: posix_memalign: 00000000026D67F0:512 @16
2016/12/14 12:03:55 [debug] 12676#12676: *33 accept: 127.0.0.1:44642 fd:3
2016/12/14 12:03:55 [debug] 12676#12676: *33 event timer add: 3: 60000:1481717095688
2016/12/14 12:03:55 [debug] 12676#12676: *33 reusable connection: 1
2016/12/14 12:03:55 [debug] 12676#12676: *33 epoll add event: fd:3 op:1 ev:80002001
2016/12/14 12:03:55 [debug] 12676#12676: *33 http wait request handler
2016/12/14 12:03:55 [debug] 12676#12676: *33 malloc: 00000000026D6A00:1024
2016/12/14 12:03:55 [debug] 12676#12676: *33 recv: eof:0, avail:1
2016/12/14 12:03:55 [debug] 12676#12676: *33 recv: fd:3 78 of 1024
2016/12/14 12:03:55 [debug] 12676#12676: *33 reusable connection: 0
2016/12/14 12:03:55 [debug] 12676#12676: *33 posix_memalign: 000000000270FAC0:4096 @16
2016/12/14 12:03:55 [debug] 12676#12676: *33 http process request line
2016/12/14 12:03:55 [debug] 12676#12676: *33 http request line: "GET /purge HTTP/1.1"
2016/12/14 12:03:55 [debug] 12676#12676: *33 http uri: "/purge"
2016/12/14 12:03:55 [debug] 12676#12676: *33 http args: ""
2016/12/14 12:03:55 [debug] 12676#12676: *33 http exten: ""
2016/12/14 12:03:55 [debug] 12676#12676: *33 http process request header line
2016/12/14 12:03:55 [debug] 12676#12676: *33 http header: "User-Agent: curl/7.35.0"
2016/12/14 12:03:55 [debug] 12676#12676: *33 http header: "Host: localhost"
2016/12/14 12:03:55 [debug] 12676#12676: *33 http header: "Accept: */*"
2016/12/14 12:03:55 [debug] 12676#12676: *33 http header done
2016/12/14 12:03:55 [debug] 12676#12676: *33 event timer del: 3: 1481717095688
2016/12/14 12:03:55 [debug] 12676#12676: *33 generic phase: 0
2016/12/14 12:03:55 [debug] 12676#12676: *33 rewrite phase: 1
2016/12/14 12:03:55 [debug] 12676#12676: *33 test location: "/"
2016/12/14 12:03:55 [debug] 12676#12676: *33 test location: "purge"
2016/12/14 12:03:55 [debug] 12676#12676: *33 using configuration "/purge"
2016/12/14 12:03:55 [debug] 12676#12676: *33 http cl:-1 max:1048576
2016/12/14 12:03:55 [debug] 12676#12676: *33 rewrite phase: 3
2016/12/14 12:03:55 [debug] 12676#12676: *33 post rewrite phase: 4
2016/12/14 12:03:55 [debug] 12676#12676: *33 generic phase: 5
2016/12/14 12:03:55 [debug] 12676#12676: *33 generic phase: 6
2016/12/14 12:03:55 [debug] 12676#12676: *33 generic phase: 7
2016/12/14 12:03:55 [debug] 12676#12676: *33 access phase: 8
2016/12/14 12:03:55 [debug] 12676#12676: *33 access phase: 9
2016/12/14 12:03:55 [debug] 12676#12676: *33 access phase: 10
2016/12/14 12:03:55 [debug] 12676#12676: *33 post access phase: 11
2016/12/14 12:03:55 [debug] 12676#12676: *33 posix_memalign: 00000000026EB020:4096 @16
2016/12/14 12:03:55 [debug] 12676#12676: *33 http set discard body
2016/12/14 12:03:55 [debug] 12676#12676: *33 http cache key: "/test"
2016/12/14 12:03:55 [debug] 12676#12676: *33 add cleanup: 00000000026EB6F8
2016/12/14 12:03:55 [debug] 12676#12676: *33 http file cache exists: 0 e:1
2016/12/14 12:03:55 [debug] 12676#12676: *33 cache file: "/data/nginx/img_cache/9/ac/4539330648b80f94ef3bf911f6d77ac9"
2016/12/14 12:03:55 [debug] 12676#12676: *33 add cleanup: 00000000026EB750
2016/12/14 12:03:55 [debug] 12676#12676: *33 http file cache fd: 10
2016/12/14 12:03:55 [debug] 12676#12676: *33 read: 10, 00000000026EB7D0, 390, 0
2016/12/14 12:03:55 [debug] 12676#12676: *33 HTTP/1.1 200 OK
Server: nginx/1.11.6
Date: Wed, 14 Dec 2016 12:03:55 GMT
Content-Type: text/html
Content-Length: 265
Connection: keep-alive

2016/12/14 12:03:55 [debug] 12676#12676: *33 write new buf t:1 f:0 00000000026EBB08, pos 00000000026EBB08, size: 148 file: 0, size: 0
2016/12/14 12:03:55 [debug] 12676#12676: *33 http write filter: l:0 f:0 s:148
2016/12/14 12:03:55 [debug] 12676#12676: *33 http output filter "/purge?"
2016/12/14 12:03:55 [debug] 12676#12676: *33 http copy filter: "/purge?"
2016/12/14 12:03:55 [debug] 12676#12676: *33 http postpone filter "/purge?" 00007FFF36D57700
2016/12/14 12:03:55 [debug] 12676#12676: *33 write old buf t:1 f:0 00000000026EBB08, pos 00000000026EBB08, size: 148 file: 0, size: 0
2016/12/14 12:03:55 [debug] 12676#12676: *33 write new buf t:1 f:0 00000000026EB9A8, pos 00000000026EB9A8, size: 265 file: 0, size: 0
2016/12/14 12:03:55 [debug] 12676#12676: *33 http write filter: l:1 f:0 s:413
2016/12/14 12:03:55 [debug] 12676#12676: *33 http write filter limit 0
2016/12/14 12:03:55 [debug] 12676#12676: *33 writev: 413 of 413
2016/12/14 12:03:55 [debug] 12676#12676: *33 http write filter 0000000000000000
2016/12/14 12:03:55 [debug] 12676#12676: *33 http copy filter: 0 "/purge?"
2016/12/14 12:03:55 [debug] 12676#12676: *33 http finalize request: 0, "/purge?" a:1, c:2
2016/12/14 12:03:55 [debug] 12676#12676: *33 http request count:2 blk:0
2016/12/14 12:03:55 [debug] 12676#12676: *33 http finalize request: -4, "/purge?" a:1, c:1
2016/12/14 12:03:55 [debug] 12676#12676: *33 set http keepalive handler
2016/12/14 12:03:55 [debug] 12676#12676: *33 http close request
2016/12/14 12:03:55 [debug] 12676#12676: *33 http log handler
2016/12/14 12:03:55 [debug] 12676#12676: *33 run cleanup: 00000000026EB750
2016/12/14 12:03:55 [debug] 12676#12676: *33 file cleanup: fd:10
2016/12/14 12:03:55 [debug] 12676#12676: *33 run cleanup: 00000000026EB6F8
2016/12/14 12:03:55 [debug] 12676#12676: *33 http file cache cleanup
2016/12/14 12:03:55 [debug] 12676#12676: *33 http file cache free, fd: 10
2016/12/14 12:03:55 [debug] 12676#12676: *33 free: 000000000270FAC0, unused: 0
2016/12/14 12:03:55 [debug] 12676#12676: *33 free: 00000000026EB020, unused: 839
2016/12/14 12:03:55 [debug] 12676#12676: *33 free: 00000000026D6A00
2016/12/14 12:03:55 [debug] 12676#12676: *33 hc free: 0000000000000000 0
2016/12/14 12:03:55 [debug] 12676#12676: *33 hc busy: 0000000000000000 0
2016/12/14 12:03:55 [debug] 12676#12676: *33 tcp_nodelay
2016/12/14 12:03:55 [debug] 12676#12676: *33 reusable connection: 1
2016/12/14 12:03:55 [debug] 12676#12676: *33 event timer add: 3: 65000:1481717100688
2016/12/14 12:03:55 [debug] 12676#12676: *33 http keepalive handler
2016/12/14 12:03:55 [debug] 12676#12676: *33 malloc: 00000000026D6A00:1024
2016/12/14 12:03:55 [debug] 12676#12676: *33 recv: eof:1, avail:1
2016/12/14 12:03:55 [debug] 12676#12676: *33 recv: fd:3 0 of 1024
2016/12/14 12:03:55 [info] 12676#12676: *33 client 127.0.0.1 closed keepalive connection
2016/12/14 12:03:55 [debug] 12676#12676: *33 close http connection: 3
2016/12/14 12:03:55 [debug] 12676#12676: *33 event timer del: 3: 1481717100688
2016/12/14 12:03:55 [debug] 12676#12676: *33 reusable connection: 0
2016/12/14 12:03:55 [debug] 12676#12676: *33 free: 00000000026D6A00
2016/12/14 12:03:55 [debug] 12676#12676: *33 free: 00000000026D67F0, unused: 128
Altimit commented 7 years ago

@denji Tried nginx-1.11.10. Same thing.

built by gcc 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04) 
built with OpenSSL 1.1.0d  26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie' --with-openssl=/home/wizard/dist/test2/openssl-1.1.0d --add-dynamic-module=/home/wizard/dist/test2/ngx_cache_purge

Recompiled it with FRiCKLE/ngx_cache_purge, but using config from this repo. In this case everything works fine.

denji commented 7 years ago

@Altimit FRiCKLE/ngx_cache_purge-2.3 does not support dynamic modules (--add-module=…/ngx_cache_purge).

Recompiled it with FRiCKLE/ngx_cache_purge … In this case everything works fine. --add-dynamic-module=/home/wizard/dist/test2/ngx_cache_purge

Altimit commented 7 years ago

@denji If I'm right, it doesn't support dynamic modules only because of it's config file. So, as I've mentioned, I took config file from this repo https://github.com/nginx-modules/ngx_cache_purge/blob/master/config

Altimit commented 7 years ago

@denji Sorry for misleading. In this configuration it also doesn't work. Worker process crashes when I use PURGE method. I tried to play with different versions of nginx, openssl and ngx_cache_purge module. So I've found out that the problem is presumably caused by newer verson of nginx. nginx-1.11.1 + nginx-modules/ngx_cache_purge + OpenSSL 1.0.1f works.

nginx version: nginx/1.11.1
built by gcc 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04) 
built with OpenSSL 1.0.1f 6 Jan 2014
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --add-dynamic-module=/home/wizard/dist/test3/ngx_cache_purge --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-http_perl_module=dynamic --add-dynamic-module=debian/extra/njs-1c50334fbea6/nginx --with-threads --with-stream --with-stream_ssl_module --with-http_slice_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --with-http_v2_module --with-cc-opt='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro'

nginx-1.11.10 + nginx-modules/ngx_cache_purge + OpenSSL 1.0.1f crashes the worker.

nginx version: nginx/1.11.10
built by gcc 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04) 
built with OpenSSL 1.0.1f 6 Jan 2014
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie' --add-dynamic-module=/home/wizard/dist/test2/ngx_cache_purge
denji commented 7 years ago

@Altimit nginx-1.11 unstable mainline, it may be better with nginx-1.10, or just lasted version of nginx-1.11?

denji commented 7 years ago

@Altimit 1.11.10 https://nginx.org/en/CHANGES