Welcome! Log In Create A New Profile

Advanced

Re: Proxy cache

henrique matias
April 18, 2013 01:06PM
Am completely sure its possible, am just not the nginx specialist, so i
might not point you to the best directions.

But as far as i understand in my little time together with things beautiful
thing called nginx, you should have a look on this:

http://wiki.nginx.org/HttpCoreModule#root

let me know the results you achieve, since i'll be soon passing by the same
problem :P


On 18 April 2013 17:19, <kristofer@cybernetik.net> wrote:

> Hello,
>
> I am using nginx as a reverse proxy to cache content for an application.
> Requests to the application are expensive, so I would like to set up
> caching so that if the file exists in nginx, it won't even bother querying
> the backend server.
>
> I can't seem to figure out what I am missing.
>
> This is how I am set up:
>
> location /download {
> index index.html index.htm;
> proxy_pass http://x.x.x.x/download;
> proxy_set_header X-Real-IP $remote_addr;
> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
> proxy_set_header Host application.domain.com;
> proxy_set_header Accept-Encoding "";
> proxy_ignore_headers Set-Cookie X-Accel-Expires Expires Cache-Control;
> if_modified_since off;
> add_header X-Cache-Status $upstream_cache_status;
>
> proxy_cache_valid 200 24h;
> expires 168h;
> proxy_cache staticfilecache;
> }
>
> proxy_cache_path /var/www/nginxcache/ levels=1:1:2
> keys_zone=staticfilecache:2000m inactive=10800m;
> proxy_cache_key "$scheme$host$request_uri$cookie_user";
>
> So for all requests to /download, I want it to serve strictly from the
> cache. I do not want it to query the proxy_pass location at all (not even
> for last modified time) if the file exists in the local cache. I just want
> it to serve the cached copy and be done.
>
> Is this possible?
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Proxy cache

Anonymous User April 18, 2013 12:20PM

Re: Proxy cache

henrique matias April 18, 2013 01:06PM

Re: Proxy cache

mex April 24, 2013 06:03AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 274
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready