# Listen on TCP.
$ModLoad imtcp

# Server side SSL.
$DefaultNetstreamDriver gtls

# Self-signed, CA == Cert.
$DefaultNetstreamDriverCAFile <%= @cert_file %>
$DefaultNetstreamDriverCertFile <%= @cert_file %>
$DefaultNetstreamDriverKeyFile <%= @key_file %>

# Verify server, not client.
$InputTCPServerStreamDriverMode 1
$InputTCPServerStreamDriverAuthMode anon

# Temporarily disable message de-dupe.
$RepeatedMsgReduction off

# Switch to remote ruleset
$RuleSet cdn

# Record raw message content without leading space.
$template NoFormat,"%msg:2:$:%\n"

# Log everything from this source.
*.* -<%= @log_dir -%>/bouncer_and_redirector.log;NoFormat

# Switch back to default ruleset
$RuleSet RSYSLOG_DefaultRuleset

$InputTCPServerBindRuleset cdn
$InputTCPServerRun <%= @port %>

# Restore message de-dupe.
$RepeatedMsgReduction on

# Use the same max-line-length as Fastly
$MaxMessageSize 16k

# Listen on TCP.
$ModLoad imtcp

# Server side SSL.
$DefaultNetstreamDriver gtls

# Self-signed, CA == Cert.
$DefaultNetstreamDriverCAFile <%= @cert_file %>
$DefaultNetstreamDriverCertFile <%= @cert_file %>
$DefaultNetstreamDriverKeyFile <%= @key_file %>

# Verify server, not client.
$InputTCPServerStreamDriverMode 1
$InputTCPServerStreamDriverAuthMode anon

# Temporarily disable message de-dupe.
$RepeatedMsgReduction off

# Switch to remote ruleset
$RuleSet cdn

# Record raw message content without leading space.
$template NoFormat,"%msg:2:$:%\n"

# Use the same max-line-length as Fastly
$MaxMessageSize 16k

# Log everything from this source.
*.* -<%= @log_dir -%>/bouncer_and_redirector.log;NoFormat

# Switch back to default ruleset
$RuleSet RSYSLOG_DefaultRuleset

$InputTCPServerBindRuleset cdn
$InputTCPServerRun <%= @port %>

# Restore message de-dupe.
$RepeatedMsgReduction on

Move MaxMessageSize directive to before output line
Move MaxMessageSize directive to before output line

We think that the order of directives may make a difference. It wasn't working
where it was.
