<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                置 `nginx` 格式為 `json` ,這樣便于人性化閱讀,也方便將 `nginx` 日志對接到 `elk(elasticsearch+logstash+kibana)` 日志管理中心。 這里要說明一點:日志格式修改為 `json` ,對 `nginx` 沒有任何影響,請放心修改。 我們以 `nginx.conf` 為例進行配置演示 ``` user www www; worker_processes auto; pid /var/run/nginx.pid; events { use epoll ; worker_connections 4096; multi_accept on; } http { include mime.types; default_type application/octet-stream; vhost_traffic_status_zone; vhost_traffic_status_filter_by_host on; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; server_names_hash_bucket_size 512 ; client_header_buffer_size 128k; large_client_header_buffers 8 64k; client_max_body_size 500m; #這里定義 access 日志格式 為json格式 log_format json '{"created_at":"$time_iso8601",' '"remote_addr":"$remote_addr",' '"method":"$request_method",' '"request":"$request",' '"status":"$status",' '"size":$body_bytes_sent,' '"referer": "$http_referer",' '"http_host":"$http_host",' '"response_time":$request_time,' '"http_x_forwarded_for":"$http_x_forwarded_for",' '"user_agent": "$http_user_agent"' '}' ; # 接口訪問日志的最后一個參數 json 是前面定義的,這里引用一下 access_log /usr/local/nginx/logs/access.log json; # 注意:錯誤日志沒有格式,nginx 默認語法即可 error_log /usr/local/nginx/logs/error.log; server{ listen 80 ; # 站點域名,沒有的話,寫項目名稱即可 server_name www.ginskeleton.com ; charset utf-8 ; location / { root /usr/local/nginx/html; index index.html index.htm; } # 提供 nginx 運行指標采集接口,供 prometheus 軟件采集 location /status { vhost_traffic_status_display; vhost_traffic_status_display_format html; } # 以下是靜態資源緩存配置 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 12h; } location ~ /\. { deny all; } } } ``` 最終生成的日志格式: ![](https://img.kancloud.cn/fa/5e/fa5ec95ae6ded73a20d7c885bc17e2e8_1336x403.png)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看