Browse Source

fastcgi keepalive for nginx

Patrick Falls 12 years ago
parent
commit
c0fda6c262
1 changed files with 10 additions and 3 deletions
  1. 10 3
      php/deploy/nginx.conf

+ 10 - 3
php/deploy/nginx.conf

@@ -31,6 +31,11 @@ http {
 
     #gzip  on;
 
+    upstream fastcgi_backend {
+        server 127.0.0.1:9001;
+        keepalive 32;
+    }
+
     server {
         listen       8080;
         server_name  localhost;
@@ -62,11 +67,13 @@ http {
         # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
         #
         location ~ \.php$ {
-            root /home/ubuntu/FrameworkBenchmarks/php;
-            fastcgi_pass   127.0.0.1:9001;
+            root /home/pfalls/FrameworkBenchmarks/php;
+            fastcgi_pass   fastcgi_backend;
+#            fastcgi_pass 127.0.0.1:9001;
             fastcgi_index  index.php;
 #            fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
             fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
+            fastcgi_keep_conn on;
             include        /usr/local/nginx/conf/fastcgi_params;
         }
 
@@ -115,4 +122,4 @@ http {
     #    }
     #}
 
-}
+}