# NGINX config to prevent accessing php files in folders

**URL:** <https://forum.mautic.org/t/nginx-config-to-prevent-accessing-php-files-in-folders/14975>\
**Category:** Product Support\
**Created:** [June 26, 2020, 2:00pm UTC](https://forum.mautic.org/t/nginx-config-to-prevent-accessing-php-files-in-folders/14975 "2020-06-26T14:00:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gorbutt](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/gorbutt/32/703_2.png) [@gorbutt](https://forum.mautic.org/u/gorbutt)\
**Post date:** [June 26, 2020, 2:00pm UTC](https://forum.mautic.org/t/nginx-config-to-prevent-accessing-php-files-in-folders/14975/1 "2020-06-26T14:00:58Z")

</div>

**Your software**  
My Mautic version is: 3.0.0  
My PHP version is: 7.3.18

**Your problem**  
My problem is: trying to change my nginx config so no public access to php files within the subfolders.

Right now you can access files such as [https://myurl/bin/console](https://myurl/bin/console) and also [https://myurl/app/AppCache.php](https://myurl/app/AppCache.php) etc. The console tries to download and the latter php files throws an error but exposes the full local path etc.

Tried a few variations but that breaks some internal stuff.

Any thoughys/help appreciated.

Thanks, Richard
