nginx use location to set certain directories can not access the php file

# Code:
# nginx.conf written on the inside of the configuration server
path # public / bd not accessible

location ~* ^/(public/bd)/.*.(php|php5)$ {
         deny all; 
}
#nginx -s reload 一般用这个比较合理==重启过程不会影响
Service nginx restart

# See the video for more detailed process

Nginx use location to set certain directories can not access the php file

Published 29 original articles · won praise 25 · views 2205

Guess you like

Origin blog.csdn.net/wnw001/article/details/104495899