Se você não resolveu ainda, aqui está o exemplo de configuração que satisfaz seus requisitos:
server {
listen 80;
server_name img1.example;
root /var/www/images;
location / { // Users request comes in
try_files $uri @proxy; // If cache HIT goto A (show) / If cache MISS goto B (@proxy), server cached result
post_action /url.php; // post_action to another url on the backend
}
location @proxy {
proxy_pass http://static.exmaple; // Server request from backend
proxy_store /var/www/images$uri; // Store result from backend (cache)
}
}