nginx配置fastcgi以及不通过http连接进程池

server {
        listen      1180;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;


        location / {
            root   /home/wwwroot/OnlineServ;
            index  index.html index.htm index.php;
            #if (!-e $request_filename) {
            #      rewrite  ^(.*)$  /index.php?s=$1  last;
            #      break;
            #}
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ \.php(.*)$ {
            root           /home/wwwroot/OnlineServ;
           # if (!-e $request_filename) {
           #       rewrite  ^(.*)$  /index.php?s=$1  last;
           #       break;
           # }
            fastcgi_pass  unix:/tmp/php-cgi.sock;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /home/wwwroot/OnlineServ$fastcgi_script_name; 

              fastcgi_buffers 256 16k; 
fastcgi_buffer_size 128k; 
fastcgi_connect_timeout 3s; 
fastcgi_send_timeout 120s; 
fastcgi_read_timeout 120s; 
fastcgi_busy_buffers_size 256k; 
fastcgi_temp_file_write_size 256k;       

            #fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
            fastcgi_param PATH_INFO $1;
            include        fastcgi_params;
        }

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }

你可能感兴趣的:(nginx)