...
Code Block | ||||
---|---|---|---|---|
| ||||
{
"gateway": {
"clusterid": 0,
"segmentid": 0,
"environmentid": 0,
"group": "default",
"iothreads": 4,
"workerthreads": 20,
"http2": true,
"default.host": "",
"max.entity.size": 67107840,
"max.header.size": -1,
"idle.timeout": -1,
"norequest.timeout": -1,
"request.parse.timeout": -1,
"max.parameters": -1,
"max.headers": -1,
"max.cookies": -1,
"max.buffered.request.size": -1,
"always.add.date.header": true,
"sslaccelerator": {
"address": "10.1.2.3",
"header.client.ip": "X-Forwarded-For",
"header.client.port": "X-Forwarded-Port",
"header.secure": "X-SSL-Cipher",
"header.client.certificate": "X-Client-Cert"
},
"accesslog.pattern": "%{REMOTE_ADDR}(:%{REMOTE_PORT}) - "%{REMOTE_USER}" %{TIME_LOGFORMAT} "%{ORIGINAL_REQUEST}" %{HTTP_RESPONSECODE} %{HTTP_BYTESSENT} %{HTTP_RESPONSETIME} "%{HTTP_REFERER}",
"accesslog.type": "log",
"accesslog.category": "accesslog",
"accesslog.directory": "/var/log",
"accesslog.basename": "accesslog",
"accesslog.suffix": "log",
"opentelemetry.enabled": false,
"opentelemetry.requestmapper": "%{REQUEST_PATH}",
"opentelemetry.headers": "^authorization",
"errorpage": "%{script}getBody();\n\nfunction getBody() {\n var Headers = Java.type('io.undertow.util.Headers');\n var HtmlEncoder = Java.type('dk.itp.security.utils.HtmlEncoder');\n \n var errorInfo = JSON.parse(input);\n \n var reqHeaders = context.httpExchange.getRequestHeaders();\n if (reqHeaders.getFirst('Content-Type') == 'application/json' ||\n reqHeaders.getFirst('Accept').contains('application/json')) {\n context.httpExchange.getResponseHeaders().add(Headers.CONTENT_TYPE, 'application/json')\n \n var resp = {\n 'status': errorInfo.status,\n 'error': errorInfo.message\n // ,'diagnostics': errorInfo.exception\n }\n \n return JSON.stringify(resp);\n }\n \n context.httpExchange.getResponseHeaders().add(Headers.CONTENT_TYPE, 'text/html')\n \n return \"<html><head><title>Error \" + errorInfo.status + \"<\/title><\/head><body>Error \" +\n errorInfo.status + \" \" + errorInfo.message +\n// \"<pre>\" + HtmlEncoder.encode(errorInfo.exception) + \"<\/pre>\" +\n \"<\/body><\/html>\"\n}"
}
} |
...
Here, you can specify the following settings:
General
Contains general settings for the entire gateway
JSON object key is gateway
...
Default: true
JSON key: http2
Default hostname
Default hostname to use if no HOST header in request.
If not set or empty, defaults to IP of running server.
Note that you might want another default to avoid revealing internal IP - e.g. if client sends request without HOST header and you redirect to https://${HTTP_HOST} since that will reveal internal IP
Default: empty - which means using IP address of server
JSON key: default.host
Always Add Date Header
If the server should add a HTTP Date header to all response entities which do not already have one. The server sets the header right before writing the response, if none was set by other means.
Note that this setting affects all defined listeners.
...