Serve statics files EXCEPT those with a certain extension

In my Phoenix app, I want to serve all files under a certain directory EXCEPT those with a certain file extension. So, for example, I want to serve “/uploads/example.jpg” but NOT “/uploads/example.pdf”. How can I accomplish this task?

I am currently solving this in production at the level of my reverse proxy, but I am curious if there is a Phoenix-level method to prevent this. Thanks!

Nevermind. I just decided to upload these files to a non-served directory. Sorry for the confusion!