1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228
| server:
port: 8080
address: null
server-header: null
maxHttpHeaderSize: 0
shutdown: GRACEFUL
ssl: enabled: false
client-auth: none
ciphers: null,2
enabled-protocols: 1,2
key-alias: a
key-password: 123456
key-store: s
key-store-password: 123456
key-store-type: 1
key-store-provider: 1
trust-store: 1
trust-store-password: 123456
trust-store-type: 1
trust-store-provider: 2
trust-certificate: 1
trust-certificate-private-key: 1
certificate: 111
certificate-private-key: 1
protocol: TLS compression: enabled: false mimeTypes: "text/html", "text/xml", "text/plain", "text/css", "text/javascript", "application/javascript", "application/json", "application/xml" excludedUserAgents: null minResponseSize: 2KB
http2: enabled: false servlet:
context-parameters: key: value
contextPath: /
applicationDisplayName: application
registerDefaultServlet: false encoding: charset: UTF-8
force: false
forceRequest: true
forceResponse: true
mapping: key: value session: timeout: 30m
persistent: false
trackingModes:
- COOKIE
- URL
- SSL cookie: comment: null name: null domain: null path: null httpOnly: true secure: false maxAge: 3600s sameSite: NONE
reactive: session: timeout: 30m
tomcat:
access-log:
enabled: true
condition-if: null
condition-unless: null
pattern: common
directory: logs
prefix: access_log
suffix: .log
encoding: utf-8
locale: null
check-exists: false
rotate: true
rename-on-rotate: false
max-days: -1
file-date-format: .yyyy-MM-dd
ipv6-canonical: false
request-attributes-enabled: false
buffered: true
threads:
max: 200
min-spare: 10
basedir: null
background-processor-delay: 10s
max-http-form-post-size: 2MB
max-swallow-size: 2MB
redirect-context-root: true
use-relative-redirects: false
uri-encoding: UTF-8
max-connections: 8192
accept-count: 100
processor-cache: 200
keep-alive-timeout: 1024s
max-keep-alive-requests: 100
additional-tld-skip-patterns: - aa - bb
relaxed-path-chars: - < - >
relaxed-query-chars: - < - >
connection-timeout: 1024s
reject-illegal-header: true
resource:
allow-caching: true
cache-ttl: 10m
reregistration:
enabled: false
remoteip:
internal-proxies: 10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|" // 10/8 + "192\\.168\\.\\d{1,3}\\.\\d{1,3}|" // 192.168/16 + "169\\.254\\.\\d{1,3}\\.\\d{1,3}|" // 169.254/16 + "127\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|" // 127/8 + "172\\.1[6-9]{1}\\.\\d{1,3}\\.\\d{1,3}|" // 172.16/12 + "172\\.2[0-9]{1}\\.\\d{1,3}\\.\\d{1,3}|172\\.3[0-1]{1}\\.\\d{1,3}\\.\\d{1,3}|" // + "0:0:0:0:0:0:0:1|::1 # 包含传入协议的标头,通常命名为“X-Forwarded-Proto” protocolHeader: X-Forwarded-Proto # 指示传入请求是否使用 SSL 的协议标头的值 protocol-header-https-value: https # 从中提取远程主机的 HTTP 标头的名称 host-header: X-Forwarded-Host # 用于覆盖原始端口值的 HTTP 标头的名称 port-header: X-Forwarded-Port # 从中提取远程 IP 的 HTTP 标头的名称。例如,“X-FORWARDED-FOR” remote-ip-header: X-FORWARDED-FOR
|
9.0 地址 https://tomcat.apache.org/tomcat-9.0-doc/config/valve.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| 该属性的值pattern由文字文本字符串组成,并结合以“%”字符为前缀的模式标识符,以导致被当前请求和响应中的相应变量值替换。支持以下模式代码:
%a- 远程 IP 地址。另见%{xxx}a下文。 %A- 本地 IP 地址 %b- 发送的字节数,不包括 HTTP 标头,如果为零,则为“-” %B- 发送的字节数,不包括 HTTP 标头 %henableLookups- 远程主机名(如果连接器为假,则为IP 地址 ) %H- 请求协议 %l- 来自 identd 的远程逻辑用户名(总是返回“-”) %m- 请求方法(GET、POST 等) %p- 接收此请求的本地端口。另见%{xxx}p下文。 %q- 查询字符串(如果存在,则以“?”开头) %r- 请求的第一行(方法和请求 URI) %s- 响应的 HTTP 状态码 %S- 用户会话 ID %t- 日期和时间,以通用日志格式 %u- 已通过身份验证的远程用户(如果有),否则为“-”(如果需要,转义) %U- 请求的 URL 路径 %v- 本地服务器名称 %D- 处理请求所花费的时间,以毫秒为单位。注意:在 httpd 中,%D 是微秒。行为将与 Tomcat 10 及更高版本中的 httpd 保持一致。 %T- 处理请求所花费的时间,以秒为单位。注意:此值具有毫秒分辨率,而在 httpd 中它具有秒分辨率。行为将与 Tomcat 10 及更高版本中的 httpd 保持一致。 %F- 提交响应所需的时间,以毫秒为单位 %I- 当前请求线程名称(可以稍后与堆栈跟踪进行比较) %X- 响应完成时的连接状态: X= 在响应完成之前连接中止。 += 发送响应后,连接可能会保持活动状态。 -= 发送响应后将关闭连接。 还支持写入信息传入或传出标头、cookie、会话或请求属性和特殊时间戳格式。它以 Apache HTTP Server日志配置语法为模型。xxx它们中的每一个都可以使用不同的键 多次使用:
%{xxx}a写入远程地址(客户端)(xxx==remote)或连接对端地址(xxx=peer) %{xxx}i使用名称写入传入标头的值xxx(如果需要,请转义) %{xxx}o用名称写入传出标头的值xxx(如果需要,转义) %{xxx}c用名称写入 cookie 的值xxx(如果需要,转义) %{xxx}r用名称写入 ServletRequest 属性的值xxx(如果需要,转义) %{xxx}s使用名称写入 HttpSession 属性的值xxx(如果需要,请转义) %{xxx}p写入本地(服务器)端口(xxx==local)或远程(客户端)端口(xxx=remote) %{xxx}t在使用增强的 SimpleDateFormat 模式格式化的请求末尾写入时间戳xxx
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| server: port: 8060 servlet: contextPath: session: timeout: 28800s tomcat: access-log: enabled: true pattern: '"%{X-Forwarded-For}i" %a "%{remote_port}i" [%t] %h "%r" %S "%{Cookie}i" %s "%{Referer}i" "%{User-Agent}i" %b %B %D %s' directory: tomcat-logs encoding: utf-8 check-exists: false rotate: true buffered: true threads: max: 500 min-spare: 10 basedir: /data/wwwroot/password-evaluation
|