Home  >  Article  >  Backend Development  >  nginx prohibits access to files with certain suffixes

nginx prohibits access to files with certain suffixes

WBOY
WBOYOriginal
2016-08-08 09:26:411979browse

Some configuration files in the web project, such as ini files, cfg files, or static template dwt, lbi files, etc., need to be set to prohibit access, otherwise they can be downloaded directly from the browser.

location ~* \.(ini|cfg|dwt|lbi)$ {  
     deny all;  
}  

The above introduces nginx's prohibition on accessing files with certain suffixes, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.

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