FastCGI backend support (#2982)

Co-authored-by: Pierrick Charron <pierrick@adoy.net>
This commit is contained in:
Charle Demers 2019-07-31 10:39:21 -04:00
parent 91a68ffc71
commit 72271e9313
No known key found for this signature in database
GPG key ID: 83CA2D7E90FF4EB9
22 changed files with 938 additions and 6 deletions

View file

@ -1295,6 +1295,16 @@ stream {
{{ range $errCode := $location.CustomHTTPErrors }}
error_page {{ $errCode }} = @custom_{{ $location.DefaultBackendUpstreamName }}_{{ $errCode }};{{ end }}
{{ if (eq $location.BackendProtocol "FCGI") }}
include /etc/nginx/fastcgi_params;
{{ end }}
{{- if $location.FastCGI.Index -}}
fastcgi_index "{{ $location.FastCGI.Index }}";
{{- end -}}
{{ range $k, $v := $location.FastCGI.Params }}
fastcgi_param {{ $k }} "{{ $v }}";
{{ end }}
{{ buildProxyPass $server.Hostname $all.Backends $location }}
{{ if (or (eq $location.Proxy.ProxyRedirectFrom "default") (eq $location.Proxy.ProxyRedirectFrom "off")) }}
proxy_redirect {{ $location.Proxy.ProxyRedirectFrom }};