How can we help you today?

Support Portal Categories

How to Deny Access to Locations and Directories

Modified on: Wed, 20 Nov, 2019 at 3:15 PM

If you want to protect a directory from being accessed through the web, create a location and deny access to it:

#Deny access to
location ~ /some/location { 
    deny all;

#Deny access to all .php files
    location ~ \.php$ {
        deny all;

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.