【问题标题】:Convert Apache command to nginx (FilesMatch)将 Apache 命令转换为 nginx (FilesMatch)
【发布时间】:2017-04-11 12:44:43
【问题描述】:

如何阻止通过浏览器查看某些类型的文件来配置Nginx?

<FilesMatch "\.(htaccess|htpasswd|ini|phps|fla|psd|log|sh)$">
    Order Allow,Deny
    Deny from all
</FilesMatch>

【问题讨论】:

    标签: apache nginx code-conversion


    【解决方案1】:

    这是 NginX 版本:

    location ~ \.(htaccess|htpasswd|ini|phps|fla|psd|log|sh)$ {
      deny all;
    }
    

    【讨论】:

      猜你喜欢
      • 2017-04-11
      • 2020-12-23
      • 1970-01-01
      • 2014-09-24
      • 2015-05-21
      • 2011-11-25
      • 2012-07-19
      • 2021-11-26
      • 2021-12-28
      相关资源
      最近更新 更多