zoukankan      html  css  js  c++  java
  • location 禁止以/data开头的文件

    [root@web01 default]# tree data/
    data/
    └── index.html
    
    0 directories, 1 file
    [root@web01 default]# cat data/index.html 
    this is data!!!!
    [root@web01 default]# curl http://192.168.1.24/data/
    this is data!!!!
    
    [root@web01 default]# cat /app/server/nginx/conf/rewrite/default.conf 
    #rewrite ^/index.html /index.php last;
    #if (!-e $request_filename) rewrite ^/(.*)$ index.php last;
    #if (!-e $request_filename) {rewrite ^/(.*)$ /index.php last;}
    #if (!-e $request_filename) {return 404;}
    #if ($http_user_agent ~ Firefox) {rewrite ^(.*)?$ /nginx-Firefox/$1 break;}
    #if ($http_user_agent ~ MSIE) {rewrite ^(.*)$ /nginx-MSIE/$1 break;}
    #rewrite ^/(d+)/(.+)/ /$2/$1 last;
    #location ~ ^/(cron|templates)/ {deny all;break;}
    location ~ ^/data {deny all;}
    [root@web01 default]# /app/server/nginx/sbin/nginx -s reload
    [root@web01 default]# curl http://192.168.1.24/data/
    <html>
    <head><title>403 Forbidden</title></head>
    <body bgcolor="white">
    <center><h1>403 Forbidden</h1></center>
    <hr><center>nginx/1.4.4</center>
    </body>
    </html>
  • 相关阅读:
    主线程到子线程的相互切换
    IOS通过OTA部署App
    IOS应用之间调用
    静态库详解
    ObjectC的函数调用机制详解消息
    iOS6新特征:参考资料和示例汇总
    杭电acm2025
    杭电acm2051
    杭电acm1009
    杭电acm2099
  • 原文地址:https://www.cnblogs.com/bass6/p/5728197.html
Copyright © 2011-2022 走看看