HttpProxyModule vs HttpFastcgiModule

amodpandey nginx-forum at
Wed Jun 20 17:42:23 UTC 2012

1. As I understand, we have to use HttpFastcgiModule for fastcgi call
caching and HttpProxyModule for static files. Could someone please
explain the reasons for why we have this distinction. In most of the
cases I observed that there are similar directives only varying in the
prefix, fastcgi_ vs proxy_.

2. I have a nginx server that has php-fpm. There I used the fastcgi_
cache and I could see the caching. Now I have a proxy server where I
want to achieve the caching. Now, should I be using fastcgi_ cahe or
proxy_ cache? Most likely it should be proxy_ cache!! But please help me
understand. And if it proxy_ cache then having fastcgi_ cache at the
first level is meaningless. We should have been fine with proxy_ and
fastcgi_ should not have been there.

3. Clould someone also help me understand the flow of fastcgi caching.
Static caching is somewhat clear.

4. I observed that the fastcgi response is cached as HTTP response (i.e.
with HEADERS) unlike the static cache (files as sent to the client). I
hope this is right. Why is this difference as compared to static

5. Why is the temp location requied (How is spooling helpful here) ?

6. fastcgi_cache_use_stale error  timeout invalid_header http_500; -
When is this directive helpful?
I have gone through the nginx documentation. But I could not get these
answers. It would be helpful if someone explains it.

Thank you.

Posted at Nginx Forum:,227731,227731#msg-227731

More information about the nginx mailing list