Forum: NGINX can proxy_cache(nginx) in front of internal location?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2974d09ac2541e892966b762aad84943?d=identicon&s=25 ljw79618@gmail.com (Guest)
on 2014-02-28 03:57
(Received via mailing list)
I want to using proxy_cache in front of internal location,but proxy_pass
not
work.my code like following:

location /proxy {
    proxy_cache cache;
    proxy_cache_key $uri;
    proxy_cache_valid 200 304 10d;
    expires 10d;
    proxy_pass @bar;
}

location @bar {
    internal;
    content_by_lua '
            ngx.log(ngx.ERR,"sssssssssssssssssss")
            ngx.say("yaha")
        ';
}

proxy_cache must used with proxy_pass?any other method to do this?

Thanks.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,247998,247998#msg-247998
This topic is locked and can not be replied to.