Welcome! Log In Create A New Profile

Advanced

proxy and web caching

Posted by jprokopowich 
proxy and web caching
February 13, 2015 08:31AM
I have tried a few configurations to setup website caching but with no success.
I do have the proxy working however.

Can someone provide a simple config to get basic caching working. The backend is a weblogic app server.

config so far ...
http {
.
.
proxy_ignore_headers Cache-Control;
proxy_cache_path /data/web_content/cache keys_zone=content:10m loader_threshold=300 loader_files=200;
.
.
.
server {
.
.
proxy_cache content;
add_header X-Proxy-Cache $upstream_cache_status;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://service.local:7003;
.
.
}
.
.


Thanks.
Re: proxy and web caching
February 13, 2015 11:48AM
Add the cache settings;
ea.:

proxy_cache content;
proxy_cache_key $scheme$host$request_uri$request_method;
proxy_cache_valid 200 301 302 304 15s;
proxy_cache_use_stale updating error timeout invalid_header http_500;
proxy_pass_header Set-Cookie;
proxy_pass_header Cookie;
proxy_ignore_headers Cache-Control Expires Set-Cookie;

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: proxy and web caching
February 13, 2015 12:25PM
Figured it out ...

only needed,
proxy_cache_valid 200 302 301 60m;
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 299
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready