diff --git a/lib/upload.js b/lib/upload.js index 83dfa35b..c3857850 100644 --- a/lib/upload.js +++ b/lib/upload.js @@ -615,6 +615,11 @@ class BaseUpload { if (status === 423) { this._emitHttpError(req, res, 'tus: upload is currently locked; retry later') return + } else if (inStatusCategory(status, 500)) { + // Run retry logic if the server has an error, e.g. 502 Bad Gateway when + // proxied server is temporarily down. See issue #579. + this._emitHttpError(req, res, 'tus: resuming upload resulted in HTTP 500 category error') + return } if (inStatusCategory(status, 400)) {