I am using nginx for caching requests from the upstream apache server, however I want few blocks inside to be fetched from apache all the time. I am hoping ssi can do this, but the SSI tags are outputted to the user without being preprocessed.
location ~* ^.+\.html$ {
proxy_pass http://localhost:9999;
proxy_cache_key "$prime$scheme$host$request_uri";
ssi on;
ssi_silent_errors off;
log_subrequest on;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Country $country_code;
proxy_cache my-cache;
proxy_cache_bypass $http_x_refresh_cache;
proxy_cache_valid 200 302 30d;
proxy_cache_valid 404 10m;
proxy_cache_valid any 1m;
}
This is the relevant nginx conf.