Welcome! Log In Create A New Profile

Advanced

how to intercept upload file error?

how to intercept upload file error?
March 16, 2018 06:33AM
Hi,
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;
proxy_pass http://127.0.0.1:8080/catramms/uploadedBinary;

track_uploads uploads 5s;

location = /checkAuthorization {
internal;

proxy_pass http://127.0.0.1:8080/catramms/authorization;
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?

Thanks
Giuliano
Re: how to intercept upload file error?
January 29, 2019 09:46PM
Did you ever work out how to show error with temporary filename Giuliano? Having a similar Ajax post error (error 500). An error using PHP FPM and GD Library for image manipulation. And with latter things hang on resizing. Only an error 500 is given and I need more.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 279
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready