flask vs Nginx upload, server code