This script is based on https://hg.prosody.im/prosody-modules/file/f86478a02b25/mod_http_upload_external/share.php
It also supports using the file as index.php to allow stripping the php file from urls:
https://files.xmpp.msg.lol/6186af39-cc50-486e-9bc6-7f40143a62f7/pexels-photo-126407.jpeg
or
https://files.xmpp.msg.lol/index.php/6186af39-cc50-486e-9bc6-7f40143a62f7/pexels-photo-126407.jpeg
It has been changed to include proper caching headers (working with the cronjob below) to allow caching a file until it gets deleted. It also sends files with their mime type to allow displaying supported formats directly in the browser or inline in xmpp clients.