Thanks a lot for your quick reply. Some third party sdks I used only have php class, so unfortunately I can only fetch content there. But I think a simple http template module would be ideal for openresty. I did check out lapis but it seems to be quite heavy.
Actually to clarify my question in the original post, I mean is there a difference between something like
location / {
content_by_lua '
local res = ngx.location.capture("/php_b")
if res.status == 200 then
ngx.print(res.body)
end
';
}
location /php_b {
internal;
fastcgi_pass php_backend;
}
==versus a simple pass?
location / {
fastcgi_pass php_backend;
}
fc2...@gmail.com於 2013年7月2日星期二UTC+8下午10時57分07秒寫道:
After handling authentication by lua I would want to fetch content from php backend. Seems like the normal way is fastcgi_pass, but I wonder if ngx.location.capture and then print the response body would be any better?
And is proxy_pass equally valid as fastcgi_pass in this case, if the backend is php-fpm? Is there essential difference between them?
Thanks a lot!