Skip to content

Commit

Permalink
Add Stream proxy_connect_timeout and proxy_timeout support
Browse files Browse the repository at this point in the history
  • Loading branch information
kulikov-a committed Nov 20, 2023
1 parent 92a5344 commit 1b652ee
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions www/nginx/pkg-descr
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Plugin Changelog
* Move bot UA settings to GUI
* Add auto-ban logging support
* Add Upstream keepalive support
* Add Stream proxy_connect_timeout and proxy_timeout directives support
* Convert epoch time to readable format on "Banned" page
* Cosmetic: add table header borders on Traffic Statistic page for better reading

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@
<advanced>true</advanced>
<help>Due to the nature of UDP, nginx cannot know, when the communication ends and this helps as it tells nginx the number of datagrams the communication is expected to last on server side and it is expected to be closed afterwards. If you enter 0, it is expected, that the server never responds to a datagram. If nginx gets a datagram, it will still get forwarded to the client. Setting this option might be useful in (mostly) unidirectional communication as well.</help>
</field>
<field>
<id>streamserver.proxy_connect_timeout</id>
<label>Proxy Connect Timeout</label>
<type>text</type>
<advanced>true</advanced>
<help>Defines a timeout (in seconds) for establishing a connection with a proxied server.</help>
</field>
<field>
<id>streamserver.proxy_timeout</id>
<label>Proxy Timeout</label>
<type>text</type>
<advanced>true</advanced>
<help>Sets the timeout (in seconds) between two successive read or write operations on client or proxied server connections.</help>
</field>
<field>
<id>streamserver.certificate</id>
<label>TLS Certificate</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,14 @@
<Required>N</Required>
<MinimumValue>0</MinimumValue>
</proxy_responses>
<proxy_connect_timeout type="IntegerField">
<Required>N</Required>
<MinimumValue>0</MinimumValue>
</proxy_connect_timeout>
<proxy_timeout type="IntegerField">
<Required>N</Required>
<MinimumValue>0</MinimumValue>
</proxy_timeout>
</stream_server>

<sni_hostname_upstream_map type="ArrayField">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@
{% if server.proxy_responses is defined and server.proxy_responses != '' %}
proxy_responses {{ server.proxy_responses }};
{% endif%}
{% if server.proxy_connect_timeout is defined and server.proxy_connect_timeout != '' %}
proxy_connect_timeout {{ server.proxy_connect_timeout }}s;
{% endif%}
{% if server.proxy_timeout is defined and server.proxy_timeout != '' %}
proxy_timeout {{ server.proxy_timeout }}s;
{% endif%}
{% if server.trusted_proxies is defined and server.trusted_proxies != '' and server.proxy_protocol is defined and server.proxy_protocol == '1' %}
{% for trusted_proxy in server.trusted_proxies.split(',') %}
set_real_ip_from {{ trusted_proxy }};
Expand Down

0 comments on commit 1b652ee

Please sign in to comment.