文章主要分析Nginx核心配置文件 ./conf/nginx.conf
user root;
worker_processes 1;
nginx 日志级别debug | info | notice | warn | error | crit | alert | emerg,错误级别从左到右越来越大
设置nginx进程 pid
pid logs/nginx.pid;
events {
# 默认使用epoll
use epoll;
# 每个worker允许连接的客户端最大连接数
worker_connections 10240;
}
http {
}
include mime.types;
参数名 参数意义
$remote_addr 客户端ip
$remote_user 远程客户端用户名,一般为:’-’
$time_local 时间和时区
$request 请求的url以及method
$status 响应状态码
$body_bytes_send 响应客户端内容字节数
$http_referer 记录用户从哪个链接跳转过来的
$http_user_agent 用户所使用的代理,一般来时都是浏览器
$http_x_forwarded_for 通过代理服务器来记录客户端的ip
sendfile on;
tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
gzip on;
server {
listen 88;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
}
原文:https://www.cnblogs.com/dtyy/p/14123785.html