VPS侦探论坛

 找回密码
 注册
查看: 5220|回复: 2

/usr/local/nginx/logs/access.log 无法关闭

[复制链接]
发表于 2015-4-22 01:17:50 | 显示全部楼层 |阅读模式

/usr/local/nginx/conf/nginx.conf里access_log一直是关闭的,但是不清楚为什么一直有记录生成。也反复重启lnmp很多次了。
nginx.conf代码如下,望军哥指点,多谢



  1. user  www www;

  2. worker_processes auto;

  3. error_log  /home/wwwlogs/nginx_error.log  crit;

  4. pid        /usr/local/nginx/logs/nginx.pid;

  5. #Specifies the value for maximum file descriptors that can be opened by this process.
  6. worker_rlimit_nofile 51200;

  7. events
  8.         {
  9.                 use epoll;
  10.                 worker_connections 51200;
  11.                 multi_accept on;
  12.         }

  13. http
  14.         {
  15.                 include       mime.types;
  16.                 default_type  application/octet-stream;

  17.                 server_names_hash_bucket_size 128;
  18.                 client_header_buffer_size 32k;
  19.                 large_client_header_buffers 4 32k;
  20.                 client_max_body_size 50m;

  21.                 sendfile on;
  22.                 tcp_nopush     on;

  23.                 keepalive_timeout 60;

  24.                 tcp_nodelay on;

  25.                 fastcgi_connect_timeout 300;
  26.                 fastcgi_send_timeout 300;
  27.                 fastcgi_read_timeout 300;
  28.                 fastcgi_buffer_size 64k;
  29.                 fastcgi_buffers 4 64k;
  30.                 fastcgi_busy_buffers_size 128k;
  31.                 fastcgi_temp_file_write_size 256k;

  32.                 gzip on;
  33.                 gzip_min_length  1k;
  34.                 gzip_buffers     4 16k;
  35.                 gzip_http_version 1.0;
  36.                 gzip_comp_level 2;
  37.                 gzip_types       text/plain application/x-javascript text/css application/xml;
  38.                 gzip_vary on;
  39.                 gzip_proxied        expired no-cache no-store private auth;
  40.                 gzip_disable        "MSIE [1-6]\.";

  41.                 #limit_conn_zone $binary_remote_addr zone=perip:10m;
  42.                 ##If enable limit_conn_zone,add "limit_conn perip 10;" to server section.

  43.                 server_tokens off;
  44.                 #log format
  45.                 log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '
  46.              '$status $body_bytes_sent "$http_referer" '
  47.              '"$http_user_agent" $http_x_forwarded_for';

  48. server
  49.         {
  50.                 listen 80 default;
  51.                 #listen [::]:80 default ipv6only=on;
  52.                 server_name www.lnmp.org;
  53.                 index index.html index.htm index.php;
  54.                 root  /home/wwwroot/default;

  55.                 #error_page   404   /404.html;
  56.                 location ~ [^/]\.php(/|$)
  57.                         {
  58.                                 # comment try_files $uri =404; to enable pathinfo
  59.                                 try_files $uri =404;
  60.                                 fastcgi_pass  unix:/tmp/php-cgi.sock;
  61.                                 fastcgi_index index.php;
  62.                                 include fastcgi.conf;
  63.                                 #include pathinfo.conf;
  64.                         }

  65.                 location /nginx_status {
  66.                         stub_status on;
  67.                         access_log   off;
  68.                 }

  69.                 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  70.                         {
  71.                                 expires      30d;
  72.                         }

  73.                 location ~ .*\.(js|css)?$
  74.                         {
  75.                                 expires      12h;
  76.                         }

  77.                 access_log   off;
  78.         }
  79. include vhost/*.conf;
  80. }
复制代码
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2015-4-22 09:06:51 | 显示全部楼层


你在'"$http_user_agent" $http_x_forwarded_for';这一行下面添加上一行access_log off;
再重启看看
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2015-4-23 21:24:45 | 显示全部楼层

回复 2# 的帖子


果然OK了!谢谢军哥!
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-27 17:27 , Processed in 0.025037 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表