Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fastcgi_cache_purge not working #30

Open
sureddy1 opened this issue Jul 30, 2020 · 1 comment
Open

fastcgi_cache_purge not working #30

sureddy1 opened this issue Jul 30, 2020 · 1 comment

Comments

@sureddy1
Copy link

Here is my setup:

at http level:

fastcgi_cache_path /tmp/nginx-cache levels=1:2 keys_zone=WORDPRESS:100m inactive=60m;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
fastcgi_cache_use_stale error timeout invalid_header http_500;

at server level:

location ~* /purge(/.*) {
fastcgi_cache_purge WORDPRESS "$scheme$request_method$host$1";
}

No matter what purge does not work.

I enabled debug logs on nginx and here is what i see:

2020/07/30 10:18:05 [debug] 44967#44967: *7 http script var: "http"
2020/07/30 10:18:05 [debug] 44967#44967: *7 http script var: "GET"
2020/07/30 10:18:05 [debug] 44967#44967: *7 http script var: "localhost"
2020/07/30 10:18:05 [debug] 44967#44967: *7 http script capture: "/"
2020/07/30 10:18:05 [debug] 44967#44967: *7 http cache key: "httpGETlocalhost/"
2020/07/30 10:18:05 [debug] 44967#44967: *7 add cleanup: 000055DEB1BAA658
2020/07/30 10:18:05 [debug] 44967#44967: *7 http file cache exists: 0 e:1
2020/07/30 10:18:05 [debug] 44967#44967: *7 cache file: "/tmp/nginx-cache/8/60/e59c4686e1048ac50e848367eccc6608"
2020/07/30 10:18:05 [debug] 44967#44967: *7 add cleanup: 000055DEB1BAA6A8
2020/07/30 10:18:05 [debug] 44967#44967: *7 http file cache fd: 12
2020/07/30 10:18:05 [debug] 44967#44967: *7 thread read: 12, 000055DEB1BAA728, 515, 0
2020/07/30 10:18:05 [debug] 44967#44967: *7 http file cache purge: -1, "/tmp/nginx-cache/8/60/e59c4686e1048ac50e848367eccc6608"
2020/07/30 10:18:05 [debug] 44967#44967: *7 http finalize request: 500, "/purge/?" a:1, c:2
2020/07/30 10:18:05 [debug] 44967#44967: *7 http special response: 500, "/purge/?"
2020/07/30 10:18:05 [debug] 44967#44967: *7 http set discard body
2020/07/30 10:18:05 [debug] 44967#44967: *7 posix_memalign: 000055DEB1BA02B0:4096 @16
2020/07/30 10:18:05 [debug] 44967#44967: *7 HTTP/1.1 500 Internal Server Error
Server: nginx
Date: Thu, 30 Jul 2020 10:18:05 GMT
Content-Type: text/html
Content-Length: 572
Connection: close
X-Xss-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff

@sureddy1
Copy link
Author

Ok, after debugging the issue i found out that enabling aio threads was causing this issue. Once i disabled aio threads in nginx configuration purge work's fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant