varnish and apache
thanks for help, I have a question:
I installed varnish and apache, I configured Varnish in this mode:
backend default {
.host = "127.0.0.1"; # IP address of your backend (Apache, nginx, etc.)
.port = "8080"; # Port your backend is listening on
.connect_timeout = 5s;
.firstbytetimeout = 10s;
.betweenbytestimeout = 10s;
.probe = {
.url = "/";
.timeout = 500ms;
.interval = 1s;
.window = 10;
.threshold = 8;
}
}
sub vcl_recv
{
Do not cache example.com, the admin area,
logged-in users or POST requests
if (req.http.host ~ "example.com" ||
req.url ~ "^/admin" ||
req.http.Cookie ~ "logged_in" ||
req.request == "POST")
{
return (pass);
}
if (req.url ~ "(?i).(png|gif|jpeg|jpg|ico|swf|css|js|html|htm)(\?[a-z0-9]+)?$") {
unset req.http.Cookie;
}
if (!req.backend.healthy) {
unset req.http.Cookie;
}
Set Grace Time to one hour
set req.grace = 1h;
}
sub vcl_fetch
{
Set the TTL for cache object to five minutes
set beresp.ttl = 10m;
Set Grace Time to one hour
set beresp.grace = 2h;
}
and apache work to port 8080.
I wish varnish serve static pages in the cache even if apache should crash or go off, is it possible ??
thanks.
1 Reply
@ikaiser:
I wish varnish serve static pages in the cache even if apache should crash or go off, is it possible ??
thanks.
Absolutely.