more robust upload handling on nginx based servers