Welcome! Log In Create A New Profile


how to intercept upload file error?

how to intercept upload file error?
March 16, 2018 06:33AM
I'm using nginx and a fastcgi service to upload some audio-video contents.
This is my conf:
location /catramms/binary {
if ($request_method = POST) {
rewrite ^/catramms/binary/([0-9]+)/?$ /authorization?method=uploadBinary&ingestionJobKey=$1&X-Progress-ID=$1 last;

location /authorization {
auth_request /checkAuthorization;

client_body_temp_path /tmp;

client_body_in_file_only on;

proxy_pass_request_headers on;

proxy_set_header X-FILE $request_body_file;

proxy_redirect off;
proxy_set_body off;
proxy_http_version 1.1;

track_uploads uploads 5s;

location = /checkAuthorization {

proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header X-Original-METHOD $request_method;
proxy_set_header X-Original-URI $request_uri;

The request is a POST with the content/file attached (something like curl -v -X POST -u aaa:bbb -T <myfile>.avi http://.../catramms/binary/16

In case of an error during the upload of the file (i.e. internet connection down), nginx returns an error but I need the error, with the temporary filename,
is proxied to a service.
Can I configure nginx in order to have this call in case of the error?

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 79
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready