瀏覽代碼

Merge pull request #2497 from nginx-proxy/2496

fix: use fastcgi.conf on alpine and fastcgi_params on debien
Nicolas Duchon 10 月之前
父節點
當前提交
290d275a68
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      nginx.tmpl

+ 7 - 1
nginx.tmpl

@@ -264,8 +264,14 @@
         include uwsgi_params;
         uwsgi_pass {{ trim $proto }}://{{ trim $upstream }};
         {{- else if eq $proto "fastcgi" }}
-        root {{ trim .VhostRoot }};
+            {{- if (exists "/etc/nginx/fastcgi.conf") }}
         include fastcgi.conf;
+            {{- else if (exists "/etc/nginx/fastcgi_params") }}
+        include fastcgi_params;
+            {{- else }}
+        # neither /etc/nginx/fastcgi.conf nor /etc/nginx/fastcgi_params found, fastcgi won't work
+            {{- end }}
+        root {{ trim .VhostRoot }};
         fastcgi_pass {{ trim $upstream }};
             {{- if ne $keepalive "disabled" }}
         fastcgi_keep_conn on;