nginxの学習システム - ログ

nginxの変数

HTTPリクエスト変数

arg_PARAMETER、HTTP_HEADER、sent_http_HEADER

ヘッダが指定されたヘッダを交換、変更は、ユーザエージェントは下線が引かれているようなバーHTTP_USER_AGENT

組み込み変数

nginxのは、建て
http://nginx.org/en/docs/syslog.html

カスタム変数

彼らの定義

ロギング設定

エラーログ

user  nginx;
worker_processes  1;

# 日志存放路径
error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}

access.log

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"'
                      '"$upstream_cache_status"';
	# access_log路径,表示以main格式记录在access_log里
    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;
}
公開された65元の記事 ウォンの賞賛3 ビュー50000 +

おすすめ

転載: blog.csdn.net/web_orange/article/details/105004571