Replacing the body of a proxied subrequest with the contents of a file
I'm using the upload module to write the uploaded file to disk as soon as it arrives in nginx. In addition, I'd like to create 2 subrequests:
- POST to a URL containing the uploaded file
- POST to another URL without the uploaded file
The second request is easy to do because the upload module has already stripped out the upload. My problem is with the first 开发者_运维知识库request: How do I get the uploaded file back into the the subrequest.
A solution for my question has been committed to the echo module.
The module you linked to has the upload_set_form_field
directive and a few special variables (listed in that directive), which you can use to pass the file details to the backend as a POST variables. The example given appears to put the upload back in the POST data. Can you adapt your backend script to make that work?
精彩评论