Han Pieter,
This needs to be setup in your nginx configuration, see https://github.com/mendix/m2ee-tools/blob/develop/doc/nginx.md
Specifically the section in to config with the proxy-pass for the file request handler:
location = /file
Hope this helps in setting up your server.