The current template we use
This commit is contained in:
parent
cbb85a0234
commit
45ba1ded85
1 changed files with 31 additions and 7 deletions
|
@ -405,13 +405,11 @@ http {
|
||||||
}
|
}
|
||||||
|
|
||||||
stream {
|
stream {
|
||||||
log_format log_stream {{ $cfg.LogFormatStream }};
|
log_format proxy '$msec $remote_addr:$remote_port $ssl_preread_server_name '
|
||||||
|
'$protocol st:$status bs:$bytes_sent br:$bytes_received '
|
||||||
{{ if $cfg.DisableAccessLog }}
|
'sesstime:$session_time pod:"$upstream_addr" '
|
||||||
access_log off;
|
'ubs:"$upstream_bytes_sent" ubr:"$upstream_bytes_received" uct:"$upstream_connect_time"';
|
||||||
{{ else }}
|
access_log /var/log/nginx/access.log proxy if=$bytes_received;
|
||||||
access_log {{ $cfg.AccessLogPath }} log_stream;
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
error_log {{ $cfg.ErrorLogPath }};
|
error_log {{ $cfg.ErrorLogPath }};
|
||||||
|
|
||||||
|
@ -441,6 +439,32 @@ stream {
|
||||||
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
# SNI services
|
||||||
|
map $ssl_preread_server_name $name {
|
||||||
|
{{ range $i, $sniServer := .SNIBackends }}
|
||||||
|
{{ $sniServer.Backend.ServerName }} sni-{{ $sniServer.Port }}-{{ $sniServer.Backend.Namespace }}-{{ $sniServer.Backend.Name }}-{{ $sniServer.Backend.Port }};
|
||||||
|
{{ end }}
|
||||||
|
}
|
||||||
|
|
||||||
|
{{ range $i, $sniServer := .SNIBackends }}
|
||||||
|
upstream sni-{{ $sniServer.Port }}-{{ $sniServer.Backend.Namespace }}-{{ $sniServer.Backend.Name }}-{{ $sniServer.Backend.Port }} {
|
||||||
|
{{ range $j, $endpoint := $sniServer.Endpoints }}
|
||||||
|
server {{ $endpoint.Address }}:{{ $endpoint.Port }};
|
||||||
|
{{ end }}
|
||||||
|
}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
proxy_protocol on;
|
||||||
|
proxy_timeout 305;
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 8443 reuseport;
|
||||||
|
ssl_preread on;
|
||||||
|
proxy_pass $name;
|
||||||
|
proxy_timeout 305;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# UDP services
|
# UDP services
|
||||||
{{ range $i, $udpServer := .UDPBackends }}
|
{{ range $i, $udpServer := .UDPBackends }}
|
||||||
upstream udp-{{ $udpServer.Port }}-{{ $udpServer.Backend.Namespace }}-{{ $udpServer.Backend.Name }}-{{ $udpServer.Backend.Port }} {
|
upstream udp-{{ $udpServer.Port }}-{{ $udpServer.Backend.Namespace }}-{{ $udpServer.Backend.Name }}-{{ $udpServer.Backend.Port }} {
|
||||||
|
|
Loading…
Reference in a new issue