网页的根目录本来是: 6 root /app/www/default;

 [root@web01 default]# cat /app/server/nginx/conf/vhosts/default.conf
server {
listen ;
server_name espressos.cn;
index index.php index.htm index.html;
root /app/www/default;
location ~ .*\.(sh|bash)?$
{
return ;
}
# if (!-e $request_filename) {
# rewrite ^/(.*)$ /index.php last;
# }
location ~ .*\.(php|php5)?$
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}
include /app/server/nginx/conf/rewrite/default.conf;
access_log /app/log/nginx/access/default.log;
}

参数:access_log off ------->关闭了记录这个页面的到访问日志里!!!默认是记录访问日志的。

[root@web01 default]# tree /app/www/default/
/app/www/default/ directories, files
[root@web01 default]# tree /app/www/html/
/app/www/html/
└── m.js directories, file
[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+)/(.+)/ /$?id=$ last;
#location ~ ^/(cron|templates)/ {deny all;break;}
#location ~ ^/data {deny all;}
location ^~ /html/m.js {access_log off;root /app/www;expires ;break;}#expires 5 有效期为5秒!!
[root@web01 default]# tail -f /app/log/nginx/access/
default.log sx.log
[root@web01 default]# tail - /app/log/nginx/access/default.log
192.168.1.10 - - [/Aug/::: +] "GET /html/%5C%22/images/upload/Image/1_07(61).jpg%5C%22 HTTP/1.1" "http://192.168.1.24/html/sql.html" "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0"

location 设定某个文件的过期时间,并不记录访问日志的更多相关文章

  1. LNMP-Nginx配置不记录静态文件、过期时间

    用户访问web网站,通常日志文件会记录很多web站点上的一些静态文件信息,如果长期不处理,日志文件会越来越大,占用的系统资源也越大,此时就需要我们配置不记录静态文件和过期时间,减少日志文件记录过多不必 ...

  2. Nginx图片及样式文件不记录访问日志

    1.Nginx作为web服务器是可直接在server配置文件中做如下配置: server { listen ; server_name www.fansik.com; access_log /data ...

  3. Oracle密码概要文件,密码过期时间180天修改为3天,相关用户密码是否过期

    #Oracle用户密码,概要文件修改测试 #默认的用户使用概要文件,默认概要文件密码过期时间参数180天,修改为3天,对于老的用户来说,是密码过期,还是未发生改变, 对于新用户来说,新设置的密码过期时 ...

  4. (转)网站速度优化技巧:Nginx设置js、css过期时间

    网站速度优化技巧:Nginx设置js.css过期时间 原文:http://www.webkaka.com/blog/archives/Nginx-set-the-expiration-time-for ...

  5. Redis学习笔记(十)——过期时间、访问限制与缓存

    http://irfen.me/redis-learn-10-time-expire-limit-cache/ 过期时间 之前应该提到过 redis 的特性之一是可以设置键的超时时间.命令是expir ...

  6. Nginx访问日志、 Nginx日志切割、静态文件不记录日志和过期时间

    1.Nginx访问日志 配制访问日志:默认定义格式: log_format combined_realip '$remote_addr $http_x_forwarded_for [$time_loc ...

  7. Nginx访问日志、日志切割、静态文件不记录日志和过期时间

    6月8日任务 12.10 Nginx访问日志12.11 Nginx日志切割12.12 静态文件不记录日志和过期时间 12.10 Nginx访问日志 除了在主配置文件nginx.conf里定义日志格式外 ...

  8. Linux centosVMware Nginx访问日志、Nginx日志切割、静态文件不记录日志和过期时间

    一.Nginx访问日志 vim /usr/local/nginx/conf/nginx.conf //搜索log_format  日至格式 改为davery格式 $remote_addr  客户端IP ...

  9. nginx日志、nginx日志切割、静态文件不记录日志和过期时间

    2019独角兽企业重金招聘Python工程师标准>>> 12.10 Nginx访问日志 日志格式 vim /usr/local/nginx/conf/nginx.conf //搜索l ...

随机推荐

  1. highchart 图标技术

    1.部分html文件 <div region="center" style="width: 100%; height: 100%;"> <ta ...

  2. 突破技术管理,IT人中年危机变契机

    突破技术管理,IT人中年危机变契机 中生代技术 Yesterday 作为一个老技术人,今天不聊技术,就聊点技术人员职业发展的事情:对技术管理岗位的认知,比如技术总监. 先贴一张技术人员职业发展路线图, ...

  3. ECMAScript新特性【一】--Object.create

    Object.create(prototype, descriptors) :创建一个具有指定原型且可选择性地包含指定属性的对象 参数: prototype 必需.  要用作原型的对象. 可以为 nu ...

  4. STL iterator和reverse_iterator

    先看一段代码: #include <iostream> #include <deque> #include <algorithm> #include <ite ...

  5. 给文件夹添加Everyone用户

    DOC命令 C# code 1. cacls C:dming /g everyone:f /e /t 这样可以添加 2. cacls C:Program Files客友软件 /g everyone:f ...

  6. HDU1411++几何+四面体体积

    公式题... 自己闲的用cos sin推出个公式 还不知道对不对,明天补上.. #include<stdio.h> #include<math.h> #include<i ...

  7. Android从无知到有知——NO.2

    这几天虽说偶遇瓶颈.但也渐入佳境.因为之前没有接触过android,所以作为一个新手不会给自己过高的要求.相比于去年做的分布式资源检索,今年的移动开发着实要简单一些.尽管其本质没有太大的差别,但从用户 ...

  8. Kubenertes资源分配之Request和Limit解析

    收录待用,修改转载已取得腾讯云授权 Kubernetes是一个容器集群管理平台,Kubernetes需要统计整体平台的资源使用情况,合理地将资源分配给容器使用,并且要保证容器生命周期内有足够的资源来保 ...

  9. JQuery 控制div滚动条保持最下

    $("#session_show").animate({ scrollTop: $("#session_show").scrollHeight },1000); ...

  10. iOS buttonWithType:101 苹果私有api

    无意中发现,有人创建UIButton这样写 UIButton *previousButton = [UIButtonbuttonWithType:101]; 一看原来是私有api UIButton * ...