Created
October 29, 2012 05:46
-
-
Save davidbirdsong/3971801 to your computer and use it in GitHub Desktop.
set_body_file not working as expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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