fastcgi_cache with conditional purging question


#1

I followed the article you wrote where you say to run a test to see if fastcgi_cache is installed on our system properly or not.

nginx -V 2>&1 | grep nginx-cache-purge -o

Now when I setup my last server, I followed the directions step by step even using brianmercers ppa and sure enough the command showed that i had fastcgi_cache installed.

This time around, because I wanted a few more modules, I compiled nginx from source and added 'what I believe' to be the fastcgi_cache module.

I am posting this because when I run your command I do NOT see the fastcgi_cache, but when I compiled nginx I got no errors and it seemes to run perfectly.

Here is my ./configure for nginx

./configure --add-module='/downloads/nginx/naxsi-core-0.51-1/naxsi_src' \  
--sbin-path=/usr/sbin \  
--conf-path=/etc/nginx/nginx.conf \  
--pid-path=/var/run/nginx.pid \  
--error-log-path=/var/log/nginx/error.log \  
--pid-path=/var/run/nginx.pid \  
--with-ipv6  \  
--with-http_ssl_module  \  
--with-http_spdy_module \  
--with-http_realip_module \  
--add-module='/downloads/nginx/ngx_pagespeed-release-1.6.29.5-beta/' \  
--add-module='/downloads/nginx/ngx_cache_purge-2.1' \  
--add-module='/downloads/nginx/ngx_http_redis-0.3.6' \  
--add-module='/downloads/nginx/headers-more-nginx-module-0.21/' \  
--without-mail_pop3_module \  
--without-mail_imap_module \  
--without-mail_smtp_module \  
--with-http_stub_status_module  

Now the version of the cache purge that I compiled into my nginx install was from: http://labs.frickle.com/nginx_ngx_cache_purge/

Did I use the right cache purge module?

Because I do not see the output when I run that command, is there another way I can test and make sure it is working properly?


#2

http://labs.frickle.com/nginx_ngx_cache_purge/ is correct module.

If Nginx is complied without it, you will get error when you will test nginx configuration for directive fastcgi_cache_purge


#3

when I run this command:
nginx -V 2>&1

Then I see:


nginx version: nginx/1.4.2
built by gcc 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1)
TLS SNI support enabled
configure arguments: --add-module=/downloads/nginx/naxsi-core-0.51-1/naxsi_src --sbin-path=/usr/sbin --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --with-ipv6 --with-http_ssl_module --with-http_spdy_module --with-http_realip_module --with-http_realip_module --add-module=/downloads/nginx/ngx_pagespeed-release-1.6.29.5-beta/ --add-module=/downloads/nginx/ngx_cache_purge-2.1 --add-module=/downloads/nginx/ngx_http_redis-0.3.6 --add-module=/downloads/nginx/headers-more-nginx-module-0.21/ --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-http_stub_status_module

Notice I have ngx_cache_purge-2.1 instead of the fastcgi_cache_purge that you show. I am using the proper download link and module and the ./configure make worked perfectly with zero errors.

However, I can’t get the header info to show up, and I don’t see another way of testing to make sure that the fastcgi_cache_purge is actually working.

Maybe I should have renamed the directory during the configure instead of leaving it ‘stock’ with the 2.1 on it?

Either way, I am seeing some seriously fast results on the server, just not sure which parts work perfect and which don’t. Just trying to learn it better is all.


#4

ngx_cache_purge is module. It adds directives fastcgi_cache_purge, proxy_cache_purge and few more.

I don't think directory name will create any issue. In fact your output already makes me believe that your nginx is compiled with fastcgi_cache_purge support. Just go ahead with config file to make use of fastcgi_cache_purge. If you get error there, then there is something to bother about.


#5