mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 13:09:18 +08:00
Merge pull request #4943 from mpalmer/log-http-host
Include HTTP Host header in nginx logs
This commit is contained in:
commit
c3ca281ea7
|
@ -25,7 +25,7 @@ map $http_x_forwarded_proto $thescheme {
|
|||
https https;
|
||||
}
|
||||
|
||||
log_format log_discourse '[$time_local] $remote_addr "$request" "$http_user_agent" "$sent_http_x_discourse_route" $status $bytes_sent "$http_referer" $upstream_response_time $request_time "$sent_http_x_discourse_username"';
|
||||
log_format log_discourse '[$time_local] "$http_host" $remote_addr "$request" "$http_user_agent" "$sent_http_x_discourse_route" $status $bytes_sent "$http_referer" $upstream_response_time $request_time "$sent_http_x_discourse_username"';
|
||||
|
||||
server {
|
||||
|
||||
|
|
|
@ -3,12 +3,12 @@ class LogAnalyzer
|
|||
class LineParser
|
||||
|
||||
|
||||
# log_format log_discourse '[$time_local] $remote_addr "$request" "$http_user_agent" "$sent_http_x_discourse_route" $status $bytes_sent "$http_referer" $upstream_response_time $request_time "$sent_http_x_discourse_username"';
|
||||
# log_format log_discourse '[$time_local] "$http_host" $remote_addr "$request" "$http_user_agent" "$sent_http_x_discourse_route" $status $bytes_sent "$http_referer" $upstream_response_time $request_time "$sent_http_x_discourse_username"';
|
||||
|
||||
attr_accessor :time, :ip_address, :url, :route, :user_agent, :rails_duration, :total_duration,
|
||||
:username, :status, :bytes_sent, :referer
|
||||
|
||||
PATTERN = /\[(.*)\] (\S+) \"(.*)\" \"(.*)\" \"(.*)\" ([0-9]+) ([0-9]+) \"(.*)\" ([0-9.]+) ([0-9.]+) "(.*)"/
|
||||
PATTERN = /\[(.*)\](?: ".*")? (\S+) \"(.*)\" \"(.*)\" \"(.*)\" ([0-9]+) ([0-9]+) \"(.*)\" ([0-9.]+) ([0-9.]+) "(.*)"/
|
||||
|
||||
TIME_FORMAT = "%d/%b/%Y:%H:%M:%S %Z"
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user