Forums

Using X-Sendfile in Flask sends empty files

My Flask app is using flask-admin, and all the static content (css, etc) was being sent as empty files. See the image enter image description here

Turns out, it was because of the USE_X_SENDFILE = True I had in my configuration. I know nginx handles x-sendfile a little differently, but don't know if this is normal or some type of configuration error.

Hi Dutchmo,

Seems like flask X-Sendfile does not work with nginx.

However, uWSGI does internal offloading (ie. if you have static mappings setup, then it sort of serves the same purpose as X-Sendfile).