# Media Exposure Vulnerability

**URL:** <https://forum.djangoproject.com/t/media-exposure-vulnerability/26863>\
**Category:** Deployment\
**Created:** [January 11, 2024, 11:06pm UTC](https://forum.djangoproject.com/t/media-exposure-vulnerability/26863 "2024-01-11T23:06:01Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [January 11, 2024, 11:23pm UTC](https://forum.djangoproject.com/t/media-exposure-vulnerability/26863/2 "2024-01-11T23:23:35Z")

</div>

> [@daniel\_rrr](#):
>
> Our problem is that on the server, the files are being served by **`nginx`** , and it ends up “overriding” the Django configuration, serving the files directly without validation, making internal system files available for public access.

If this is your root objective, then take advantage of the facilities that nginx provides for you.

Briefly, nginx provides directives that will cause it to send the requested url to a view for validation, while still allowing nginx to serve the file itself.

See [Show external folder html content in django - #2 by KenWhitesell](https://forum.djangoproject.com/t/show-external-folder-html-content-in-django/10429/2) and [Securing Uploaded Files - #2 by KenWhitesell](https://forum.djangoproject.com/t/securing-uploaded-files/6723/2) that each contain some links with options.

---

_[View the full topic](https://forum.djangoproject.com/t/media-exposure-vulnerability/26863)._
