Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am having nginx on port 80 and apache on port 8080 on same server.

I have configured nginx such that it act as reverse proxy(i am not sure whether its working or not) using this tutorial http://tumblr.intranation.com/post/766288369/using-nginx-reverse-proxy.

steps i followed to verify proxy.

  • opened same page on two different machines within an interval of 5 seconds.

but in the apache access.log every request is showing 200 response code.Does that indicate that caching is not working?

and nginx access.log is showing nothing.

share|improve this question

1 Answer 1

The tutorial that you are referring has nothing to do with nginx cache. So, it's definetly that nginx caching is not working if your config is similar to that from tutorial.

But in general, nginx has special variable:

$upstream_cache_status — keeps status of accessing a response cache (0.8.3). The status can be one of “MISS”, “BYPASS”, “EXPIRED”, “STALE”, “UPDATING” or “HIT”.

http://nginx.org/en/docs/http/ngx_http_upstream_module.html#variables

You can do with this variable whatever you want (e.g. log it into access log, or return it with the response headers).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.