Skip to content

Instantly share code, notes, and snippets.

@davidbirdsong
Created October 29, 2012 05:46
Show Gist options
  • Save davidbirdsong/3971801 to your computer and use it in GitHub Desktop.
Save davidbirdsong/3971801 to your computer and use it in GitHub Desktop.
set_body_file not working as expected
server {
server_name $hostname;
listen 80;
# add_header Content-Type application/json
location /foo {
proxy_pass http://127.0.0.1:2000;
}
location / {
client_body_in_file_only on;
lua_need_request_body on;
content_by_lua "
ngx.req.set_body_file = '/tmp/nginx.conf'
res = ngx.location.capture(
'/foo/bar',
{ method = ngx.HTTP_PUT})
ngx.say(res.body)
";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment