You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Defaults will not produce a valid configuration. Instead they are meant to showcase
711
-
# the options available for templating. Each key represents a new configuration file.
711
+
# the options available for templating. Each dictionary in the top level list/array represents a new configuration file.
712
+
# Unless otherwise noted, all variables are *strings* and *optional* (*required* values inside a dictionary are only required if the top level variable is defined).
713
+
# Most (not all) of these directives can also be used under the 'server' and 'location' contexts, as briefly seen at the end of the below dictionary.
712
714
nginx_config_stream_template_enable: false
713
715
nginx_config_stream_template:
714
716
- template_file: stream/default.conf.j2
715
-
conf_file_name: default.conf
716
-
conf_file_location: /etc/nginx/conf.d/stream/
717
-
backup: true
718
-
network_streams:
719
-
- listen:
720
-
- ip: 0.0.0.0 # Wrap in square brackets for IPv6 addresses
access: # false # Can alternatively be set to 'false'
888
+
- path: /var/log/nginx/access.log # Required
889
+
format: main
890
+
buffer: 1m
891
+
gzip: 5# Number -- Can alternatively be set to 'true'
892
+
flush: 10h
893
+
if: $loggable
894
+
error: # /var/log/nginx/error.log # String, a list of strings, a dictionary, or a list of dictionaries. The 'file' variable is only required when setting a 'level'. This directive originally belongs to the NGINX core module, but we are making an exception.
895
+
file: /var/log/nginx/error.log # Required
896
+
level: notice
897
+
# - /var/log/nginx/error.log
898
+
# - file: /var/log/nginx/error.log # Required
899
+
# level: notice
900
+
open_log_file_cache: # Set to 'false' to set to 'off'
901
+
max: 1000# Required
902
+
inactive: 20s
903
+
min_uses: 2# Number
904
+
valid: 1m
905
+
custom_directives: # String or a list of strings. Custom directive for specific use cases not covered by templates. Note: You need to add a semi-colon at the end of each directive.
hash {{ upstream['hash']['key'] }}{{ ' consistent' if upstream['hash']['consistent'] is defined and upstream['hash']['consistent'] is boolean }};
33
+
hash {{ upstream['hash']['key'] }}{{ ' consistent' if upstream['hash']['consistent'] is defined and upstream['hash']['consistent'] is boolean and upstream['hash']['consistent'] | bool }};
least_time {{ upstream['least_time']['response'] }}{{ ' inflight' if upstream['least_time']['inflight'] is defined and upstream['least_time']['inflight'] is boolean }};
39
+
least_time {{ upstream['least_time']['response'] }}{{ ' inflight' if upstream['least_time']['inflight'] is defined and upstream['least_time']['inflight'] is boolean and upstream['least_time']['inflight'] | bool }};
40
40
{%elifupstream['random'] isdefined%}
41
41
random {{ 'two' if upstream['random']['two'] is defined and upstream['random']['two'] is boolean }}{{ (' ' + upstream['random']['method'] | string) if upstream['random']['method'] is defined }};
{{- (' expires=' + upstream['sticky_cookie']['expires'] | string) if upstream['sticky_cookie']['expires'] is defined -}}
73
73
{{- (' domain=' + upstream['sticky_cookie']['domain'] | string) if upstream['sticky_cookie']['domain'] is defined -}}
74
74
{{- ' httponly' if upstream['sticky_cookie']['httponly'] is defined and upstream['sticky_cookie']['httponly'] is boolean and upstream['sticky_cookie']['httponly'] | bool -}}
75
-
{{- (' samesite' + upstream['sticky_cookie']['samesite'] | string) if upstream['sticky_cookie']['samesite'] is defined and upstream['sticky_cookie']['samesite'] in ['strict', 'lax', 'none'] -}}
75
+
{{- (' samesite=' + upstream['sticky_cookie']['samesite'] | string) if upstream['sticky_cookie']['samesite'] is defined and upstream['sticky_cookie']['samesite'] in ['strict', 'lax', 'none'] -}}
76
76
{{- ' secure' if upstream['sticky_cookie']['secure'] is defined and upstream['sticky_cookie']['secure'] is boolean and upstream['sticky_cookie']['secure'] | bool -}}
77
77
{{- (' path=' + upstream['sticky_cookie']['path'] | string) if upstream['sticky_cookie']['path'] is defined }};
hash {{ upstream['hash']['key'] }}{{ ' consistent' if upstream['hash']['consistent'] is defined and upstream['hash']['consistent'] is boolean }};
31
+
hash {{ upstream['hash']['key'] }}{{ ' consistent' if upstream['hash']['consistent'] is defined and upstream['hash']['consistent'] is boolean and upstream['hash']['consistent'] | bool }};
least_time {{ upstream['least_time']['response'] }}{{ ' inflight' if upstream['least_time']['inflight'] is defined and upstream['least_time']['inflight'] is boolean }};
35
+
least_time {{ upstream['least_time']['response'] }}{{ ' inflight' if upstream['least_time']['inflight'] is defined and upstream['least_time']['inflight'] is boolean and upstream['least_time']['inflight'] | bool }};
36
36
{%elifupstream['random'] isdefined%}
37
37
random {{ 'two' if upstream['random']['two'] is defined and upstream['random']['two'] is boolean }}{{ (' ' + upstream['random']['method'] | string) if upstream['random']['method'] is defined }};
0 commit comments