搜尋
首頁資料庫mysql教程[置顶] 详细解释:nginx中ChsHttpLogModule模块配置及各

ngx_http_log_module 实例: log_format gzip '$remote_addr - $remote_user [$time_local] ': '$request $status $bytes_sent ': '$http_referer $http_user_agent $gzip_ratio';access_log /spool/logs/nginx-access.log gzip buffer=32k; access_log 语法

ngx_http_log_module
实例:

log_format  gzip  '$remote_addr - $remote_user [$time_local]  '
: '"$request" $status $bytes_sent '
: '"$http_referer" "$http_user_agent" "$gzip_ratio"';
access_log  /spool/logs/nginx-access.log  gzip  buffer=32k;


 

access_log
语法: access_log path [format [buffer=size | off ] 默认值: access_log log/access.log combined

作用域: http, server, location

指令 access_log 指派路径、格式和缓存大小。参数 "off" 将清除当前级别的所有 access_log 指令。如果未指定格式,则使用预置的 "combined" 格式。缓存不能大于能写入磁盘的文件的最大大小。在 FreeBSD 3.0-6.0 ,缓存大小无此限制。


log_format
语法: log_format name format [format ...]

默认值: log_format combined "..."

作用域: http server

Directive log_format describes the format of a log entry. Besides general variables in the format it is possible to use variables which exist only at the moment of record into the log:

$body_bytes_sent, the number of bytes, transmitted to client minus the response headers, variable is compatible with parameter %B of module Apache's mod_log_config (this was called $apache_bytes_sent, before version 0.3.10)
$bytes_sent, the number of bytes, transmitted to client
$connection, the number of connection
$msec, the time with an accuracy to microseconds at the moment of the log entry
$pipe, "p" if request was pipelining
$request_length, the length of the body of the request
$request_time, the time of working on request in seconds
$status, status of answer
$time_local, local time into common log format.
The headers, transmitted to client, begin from the prefix "sent_http_", for example, $sent_http_content_range.

In the configuration there is always a predetermined format "combined":

log_format  combined  '$remote_addr - $remote_user [$time_local]  '
: '"$request" $status $apache_bytes_sent '
: '"$http_referer" "$http_user_agent"';

原始俄文文档:http://sysoev.ru/nginx/docs/http/ngx_http_log_module.html
陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
内存飙升!记一次nginx拦截爬虫内存飙升!记一次nginx拦截爬虫Mar 30, 2023 pm 04:35 PM

本篇文章给大家带来了关于nginx的相关知识,其中主要介绍了nginx拦截爬虫相关的,感兴趣的朋友下面一起来看一下吧,希望对大家有帮助。

2.8k屏幕是什么解析2.8k屏幕是什么解析Jan 02, 2024 pm 12:21 PM

我们经常会在购买电视,电脑或者手机时看到多少K屏幕这种介绍,例如2.8K屏幕。每当这个时候就会有对电子设备不太了解的小伙伴好奇这个2.8K屏幕到底是什么意思,分辨率又是什么。2.8k屏幕什么意思答:2.8k屏幕的意思是屏幕的分辨率为2880*18002K就是横向像素点数量大于2000,相同大小的屏幕,分辨率越高画面质量越好。分辨率介绍1、由于屏幕上的点、线和面都是由像素组成的,显示器可显示的像素越多,画面就越精细,同样的屏幕区域内能显示的信息也越多。2、分辨率越高,像素的数目越多,感应到的图像越

抖音怎么置顶自己视频抖音怎么置顶自己视频Mar 26, 2024 pm 01:21 PM

抖音里面有用户会拍摄很多的视频作品,一旦视频作品多了以后,各种优秀的视频作品就会被掩埋了,置顶功能就很有用了,那么我们怎么置顶自己的视频作品呢?接下来小编就为大家带来了抖音置顶自己视频作品方法图文教程,还不知道怎么置顶视频的用户快来看看吧。抖音使用教程抖音怎么置顶自己视频1、首先我们打开抖音,点击主界面右下角如图所示的我。2、接着我们进入个人界面后,找到想要置顶的视频作品,点击进入播放即可。3、然后我们在视频界面,点击右下角如图所示的三个点选项。4、最后我们点击新弹出窗口中的置顶即可,返回个人界

nginx php403错误怎么解决nginx php403错误怎么解决Nov 23, 2022 am 09:59 AM

nginx php403错误的解决办法:1、修改文件权限或开启selinux;2、修改php-fpm.conf,加入需要的文件扩展名;3、修改php.ini内容为“cgi.fix_pathinfo = 0”;4、重启php-fpm即可。

nginx怎么禁止访问phpnginx怎么禁止访问phpNov 22, 2022 am 09:52 AM

nginx禁止访问php的方法:1、配置nginx,禁止解析指定目录下的指定程序;2、将“location ~^/images/.*\.(php|php5|sh|pl|py)${deny all...}”语句放置在server标签内即可。

nginx部署react刷新404怎么办nginx部署react刷新404怎么办Jan 03, 2023 pm 01:41 PM

nginx部署react刷新404的解决办法:1、修改Nginx配置为“server {listen 80;server_name https://www.xxx.com;location / {root xxx;index index.html index.htm;...}”;2、刷新路由,按当前路径去nginx加载页面即可。

深析如何通过Nginx源码来实现worker进程隔离深析如何通过Nginx源码来实现worker进程隔离Nov 06, 2022 pm 04:41 PM

本文给大家介绍如何通过修改Nginx源码实现基于端口号的 Nginx worker进程隔离方案。看看到底怎么修改Nginx源码,还有Nginx事件循环、Nginx 进程模型、fork资源共享相关的知识。

探讨nginx打开php报错的原因和解决方法探讨nginx打开php报错的原因和解决方法Mar 28, 2023 pm 03:00 PM

在使用Nginx服务器的过程中,你可能会遇到打开PHP文件时出现错误的情况。这类错误一般是由于Nginx服务器对PHP文件的解析不正确所造成的。接下来,我们将一步步地探讨如何解决这一问题。

See all articles

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

AI Hentai Generator

AI Hentai Generator

免費產生 AI 無盡。

熱門文章

R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
2 週前By尊渡假赌尊渡假赌尊渡假赌
倉庫:如何復興隊友
4 週前By尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒險:如何獲得巨型種子
3 週前By尊渡假赌尊渡假赌尊渡假赌

熱工具

SublimeText3 Linux新版

SublimeText3 Linux新版

SublimeText3 Linux最新版

EditPlus 中文破解版

EditPlus 中文破解版

體積小,語法高亮,不支援程式碼提示功能

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

Dreamweaver Mac版

Dreamweaver Mac版

視覺化網頁開發工具