Hi,
I use nginx as reverse proxy and I have caching enabled.
I also use the following code:
proxy_cache_use_stale timeout error http_502 http_503 http_504 invalid_header HTTP_500;
If the backend now raises error, the page loaded from the cache.
Now I would, however, that the user knows that he just visited the page from the cache. So I got him with a note about it in the HTML code to point. However, I do not know yet how to do that. I have tried it with add_after_body, but it did not work.
My Location:
location @proxy {
proxy_pass http://127.0.0.1:8082;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_cache cache;
proxy_cache_valid 5m;
gzip off;
proxy_cache_use_stale error timeout invalid_header http_500 http_502 http_503 http_504;
add_after_body /mainpage/index.html;
}
}
I hope someone can help.
Thanks in advance
Sincerely,
florian
Edited 1 time(s). Last edit at 08/17/2011 06:42AM by Florian.