Add JSON log format to openresty

This commit is contained in:
Râu Cao
2023-07-26 11:50:24 +02:00
parent fb708743cc
commit 9854793ef0
2 changed files with 21 additions and 12 deletions

View File

@@ -11,7 +11,10 @@
}
},
"openresty": {
"listen_ip": "148.251.237.111"
"listen_ip": "148.251.237.111",
"log_formats": {
"json": "{\"ip\":\"$remote_addr\",\"time\":\"$time_local\",\"host\":\"$host\",\"method\":\"$request_method\",\"uri\":\"$uri\",\"status\":$status,\"size\":$body_bytes_sent,\"referer\":\"$http_referer\",\"upstream_addr\":\"$upstream_addr\",\"upstream_response_time\":\"$upstream_response_time\",\"ua\":\"$http_user_agent\"}"
}
}
},
"automatic": {
@@ -21,24 +24,27 @@
"hostname": "draco",
"ipaddress": "148.251.237.73",
"roles": [
"base",
"kvm_host",
"openresty_proxy",
"openresty"
],
"recipes": [
"kosmos-base",
"kosmos-base::default",
"kosmos_encfs",
"kosmos_encfs::default",
"kosmos_kvm::host",
"kosmos_kvm::backup",
"kosmos-ejabberd::firewall",
"kosmos-ipfs::firewall_swarm",
"kosmos-bitcoin::firewall",
"kosmos_zerotier::firewall",
"kosmos_openresty",
"kosmos_openresty::default",
"kosmos_openresty::firewall",
"kosmos_assets::nginx_site",
"kosmos-akkounts::nginx",
"kosmos_encfs",
"kosmos_encfs::default",
"kosmos-ejabberd::firewall",
"kosmos-ipfs::firewall_swarm",
"kosmos-bitcoin::firewall",
"kosmos_zerotier::firewall",
"sockethub::firewall",
"apt::default",
"timezone_iii::default",
@@ -54,7 +60,6 @@
"postfix::_attributes",
"postfix::sasl_auth",
"hostname::default",
"firewall::default",
"openresty::apt_package",
"openresty::ohai_plugin",
"openresty::commons_user",
@@ -65,7 +70,8 @@
"openresty::luarocks",
"git::default",
"git::package",
"kosmos-base::letsencrypt"
"kosmos-base::letsencrypt",
"firewall::default"
],
"platform": "ubuntu",
"platform_version": "20.04",
@@ -83,7 +89,9 @@
}
},
"run_list": [
"recipe[kosmos-base]",
"role[base]",
"role[kvm_host]",
"role[openresty_proxy]",
"recipe[kosmos_encfs]",
"recipe[kosmos_kvm::host]",
"recipe[kosmos_kvm::backup]",
@@ -91,7 +99,6 @@
"recipe[kosmos-ipfs::firewall_swarm]",
"recipe[kosmos-bitcoin::firewall]",
"recipe[kosmos_zerotier::firewall]",
"role[openresty_proxy]",
"recipe[sockethub::firewall]"
]
}
}