Home  >  Article  >  Backend Development  >  Disable directory running under nginx php_PHP tutorial

Disable directory running under nginx php_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 14:53:10720browse

The method of prohibiting directories from executing php under nginx is much simpler, allowing multiple directories to be set

I don’t know if I don’t understand apache. If there is a better way, I hope everyone can point it out for shared learning. thx

Location ~* ^/(attachments|images)/.*.(php|php5|PHP|PHP5)$

 {

deny all;

 }

When the web directory is not the root directory, or there are multiple directories, it can be

Location ~* ^(/discuz/|/bbs/)/(attachments|images)/.*.(php|php5|PHP|PHP5)$

 {

deny all;

 }

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/371432.htmlTechArticleThe method of prohibiting directories from executing php under nginx is much simpler. Multiple directories are allowed to be set. I don’t know if I am familiar with apache. I don’t understand that, if there is a better way, I hope you can point it out to share learning...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn