On Mon, 2009-08-17 at 14:39 -0700, mobiledreamers@gmail.com wrote:
> Hey guys
> the following is our current setup on the apps
>
>
> but we would like to add nginx as a reverse proxy cache much like
> squid or varnish
> is it possible to edit this config to enable that caching behavior or
> do i need to add another nginx in front of this set up like i would do
> for squid or varnish
>
>
> if this can be done without resorting to usage of squid and varnish it
> would be nice to have the complete setup in nginx
http {
[...]
proxy_cache_path /opt/nginx/cache levels=1:2 keys_zone=one:10m;
[...]
server {
listen 127.0.0.1:8000;
server_name localhost;
access_log /var/log/nginx/one.access.log main;
location / {
proxy_pass http://192.168.10.10:80/;
proxy_redirect off;
proxy_cache one;
proxy_cache_valid 200 1h;
[...]
}
}
Declaring cache ( proxy_cache_path ) and caching ( proxy_cache ) should
be enough.
Proxy_cache_valid in above example is used to enforce caching for
objects that have no declaration on caching.
--
Miros