How to handle SSI subrequest with proxy_store?

Hi everyone, I want to use proxy_store to cache proxies shtml files,
follow is my config:

root /cache/$host;
location / {
index index.shtml;
error_page 404 = /fetch$uri;
}
ssi on;
location /fetch {
internal;
proxy_pass http://backend;
proxy_store on;
proxy_store_access user:rw group:rw all:rw;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Via “s9/nginx”;
alias /cache/$host;
}
location ~ /$ {
index index.shtml;
error_page 403 404 = @fetch;
}
location @fetch {
internal;
proxy_pass http://backend;
proxy_store /cache/$host${uri}index.shtml;
proxy_store_access user:rw group:rw all:rw;
proxy_set_header Host $host;
proxy_set_header Via “s9/nginx”;
proxy_set_header X-Real-IP $remote_addr;
}

Now, all the “main” shtml page fetch ok and stored in local,
but can’t handle SSI subrequest( like “” …)

If I visit the “/static/header.ssi” directly, it works fine.

But, if I proxy_pass all “/static” ,it works:

location /static {
proxy_pass http://backend;
}

So, how to handle SSI subrequest with proxy_store?

Thanks much.

Pan.

I’m trying a new usenet client for Mac, Nemo OS X.
You can download it at http://www.malcom-mac.com/nemo