Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
feat: more options for Tomcat server.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
alanivey committed Nov 6, 2023
1 parent 9eeb88a commit 029da2d
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 3 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -485,3 +485,24 @@ The following environment variables can be used to create Tomcat's _server.xml_

* `TOMCAT_CONNECTOR_SECURE`: For the primary Connector, value of _secure_. If not provided and
`DHIS2_SERVER_HTTPS` is "on", the value will be "true".

* `TOMCAT_CONNECTOR_RELAXEDQUERYCHARS`: For the primary Connector, value of _relaxedQueryChars_. If
not provided, the value will be `\ { } | [ ]`.

* `TOMCAT_CONNECTOR_COMPRESSION`: For the primary Connector, value of _compression_. If not
provided, no value with be provided.

* `TOMCAT_CONNECTOR_COMPRESSIONMINSIZE`: For the primary Connector, value of _compressionMinSize_.
If not provided, no value with be provided.

* `TOMCAT_CONNECTOR_COMPRESSIBLEMIMETYPE`: For the primary Connector, value of
_compressibleMimeType_. If not provided, no value with be provided.

* `TOMCAT_CONNECTOR_NOCOMPRESSIONSTRONGETAG`: For the primary Connector, value of
_noCompressionStrongETag_. If not provided, no value with be provided.

* `TOMCAT_CONNECTOR_MAXHTTPHEADERSIZE`: For the primary Connector, value of _maxHttpHeaderSize_. If
not provided, no value with be provided.

* `TOMCAT_CONNECTOR_MAXTHREADS`: For the primary Connector, value of _maxThreads_. If not provided,
no value with be provided.
28 changes: 25 additions & 3 deletions remco/templates/tomcat/server.xml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@

<Service name="Catalina">

<Connector protocol="org.apache.coyote.http11.Http11Nio2Protocol"
port="8080"
<Connector port="8080"
protocol="org.apache.coyote.http11.Http11Nio2Protocol"
URIEncoding="UTF-8"
{% if getv("/tomcat/connector/proxyport", "8080") != "8080" %}
proxyPort="{{ getv("/tomcat/connector/proxyport") }}"
{% endif %}
Expand All @@ -24,8 +25,29 @@
{% if exists("/tomcat/connector/secure") %}
secure="{{ getv("/tomcat/connector/secure") }}"
{% endif %}
URIEncoding="UTF-8"
{% if exists("/tomcat/connector/relaxedquerychars") %}
relaxedQueryChars="{{ getv("/tomcat/connector/relaxedquerychars") }}"
{% else %}
relaxedQueryChars="\ { } | [ ]"
{% endif %}
{% if exists("/tomcat/connector/compression") %}
compression="{{ getv("/tomcat/connector/compression") }}"
{% endif %}
{% if exists("/tomcat/connector/compressionminsize") %}
compressionMinSize="{{ getv("/tomcat/connector/compressionminsize") }}"
{% endif %}
{% if exists("/tomcat/connector/compressiblemimetype") %}
compressibleMimeType="{{ getv("/tomcat/connector/compressiblemimetype") }}"
{% endif %}
{% if exists("/tomcat/connector/nocompressionstrongetag") %}
noCompressionStrongETag="{{ getv("/tomcat/connector/nocompressionstrongetag") }}"
{% endif %}
{% if exists("/tomcat/connector/maxhttpheadersize") %}
maxHttpHeaderSize="{{ getv("/tomcat/connector/maxhttpheadersize") }}"
{% endif %}
{% if exists("/tomcat/connector/maxthreads") %}
maxThreads="{{ getv("/tomcat/connector/maxthreads") }}"
{% endif %}
/>

<Engine name="Catalina" defaultHost="localhost">
Expand Down

0 comments on commit 029da2d

Please sign in to comment.