mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
www/caddy: Fix reload/stop of caddy being infinite when websocket streams of clients are open (#3934)
This commit is contained in:
@@ -30,4 +30,11 @@
|
||||
<type>checkbox</type>
|
||||
<help><![CDATA[Abort all connections that don't have a matching handle or access list. This option doesn't conflict with Let's Encrypt. Disable it for troubleshooting purposes, e.g., testing if the Reverse Proxy Domain works and the Certificate has been installed. For production use, enabling this option is recommended.]]></help>
|
||||
</field>
|
||||
<field>
|
||||
<id>caddy.general.GracePeriod</id>
|
||||
<label>Grace Period</label>
|
||||
<type>text</type>
|
||||
<hint>10</hint>
|
||||
<help><![CDATA[Defines the grace period for shutting down HTTP servers (i.e. during config changes or when Caddy is stopping) in seconds. During the grace period, no new connections are accepted, idle connections are closed, and active connections are impatiently waited upon to finish their requests. If clients do not finish their requests within the grace period, the server will be forcefully terminated to allow the reload to complete and free up resources. This can influence how long "Apply" of new configurations take, since Caddy waits for all open connections to close.]]></help>
|
||||
</field>
|
||||
</form>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<model>
|
||||
<mount>//Pischem/caddy</mount>
|
||||
<description>A GUI model for configuring a reverse proxy in the Caddy web server.</description>
|
||||
<version>1.1.8</version>
|
||||
<version>1.1.9</version>
|
||||
<items>
|
||||
<general>
|
||||
<enabled type="BooleanField">
|
||||
@@ -65,6 +65,13 @@
|
||||
</Model>
|
||||
</accesslist>
|
||||
<abort type="BooleanField"/>
|
||||
<GracePeriod type="IntegerField">
|
||||
<Default>10</Default>
|
||||
<MinimumValue>1</MinimumValue>
|
||||
<MaximumValue>3600</MaximumValue>
|
||||
<ValidationMessage>Please enter a valid Grace Period between 1 and 3600 seconds.</ValidationMessage>
|
||||
<Required>Y</Required>
|
||||
</GracePeriod>
|
||||
<LogCredentials type="BooleanField"/>
|
||||
<LogAccessPlain type="BooleanField"/>
|
||||
<LogAccessPlainKeep type="IntegerField">
|
||||
|
||||
@@ -280,6 +280,11 @@
|
||||
{% if autoHttpsValue %}
|
||||
auto_https {{ autoHttpsValue }}
|
||||
{% endif %}
|
||||
{#
|
||||
# Important: Grace Period influences how fast the server can finish reloads with open connections, by forcing termination.
|
||||
# Default of Caddy is to wait for all connections to close before allowing reload, meaning the higher the value, the longer applies take.
|
||||
#}
|
||||
grace_period {{ generalSettings.GracePeriod }}s
|
||||
import /usr/local/etc/caddy/caddy.d/*.global
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user