Source

woocode / sa-auto / conf / nginx / mpf_fcgi.conf

Full commit

#    upstream local_mpf_fcgi {
        #server 127.0.0.1:33333 weight=1;
        #server 127.0.0.1:33334 weight=1;
#        server  unix:/apps/mpf/fcgi_mpf1.sock weight=1;
#        server  unix:/apps/mpf/fcgi_mpf2.sock weight=1;
#    }



    upstream local_mpf_fcgi_3a3j {
        server  unix:/apps/mpf_3a3j/fcgi_mpf1.sock weight=1;
        server  unix:/apps/mpf_3a3j/fcgi_mpf2.sock weight=1;
    }

    upstream local_mpf_fcgi_3q44{
        server  unix:/apps/mpf_3q44/fcgi_mpf1.sock weight=1;
        server  unix:/apps/mpf_3q44/fcgi_mpf2.sock weight=1;
    }

    upstream local_mpf_fcgi_55h2 {
        server  unix:/apps/mpf_55h2/fcgi_mpf1.sock weight=1;
        server  unix:/apps/mpf_55h2/fcgi_mpf2.sock weight=1;
    }

    upstream local_mpf_fcgi_5h5z {
        server  unix:/apps/mpf_5h5z/fcgi_mpf1.sock weight=1;
        server  unix:/apps/mpf_5h5z/fcgi_mpf2.sock weight=1;
    }

   server {

        #listen       8087;
        listen       8088;
        error_page   500 502 503 504 http://www.3a3j.com/;

        server_name  *.3a3j.com *.3q44.com *.55h2.com *.5h5z.com *.5x5t.com *.6b6u.com *.8d8k.com *.8u9d.com *.96vb.com *.9ukk.com;


        log_format  mpflog  '$remote_addr [$time_local] http://$http_host$request_uri '
                      '"$status" $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

        access_log  logs/mpf_access.log  mpflog;

        location ~ .*\.gz$ {
               return 404;
         }

        location / {
           gzip off;

           #fastcgi_pass  unix:/apps/mpf/fcgi_mpf.sock;
           #fastcgi_pass  local_mpf_fcgi;

           if ( $http_host  ~ .*\.3a3j.com ) {
		fastcgi_pass local_mpf_fcgi_3a3j;
             }

           if ( $http_host  ~ .*\.3q44.com ) {
		fastcgi_pass local_mpf_fcgi_3q44;
             }

           if ( $http_host  ~ .*\.55h2.com ) {
		fastcgi_pass local_mpf_fcgi_55h2;
             }

           if ( $http_host  ~ .*\.5h5z.com ) {
		fastcgi_pass local_mpf_fcgi_5h5z;
             }


           fastcgi_index index.cgi;
           fastcgi_param SCRIPT_FILENAME    /var/www/cgi-bin$fastcgi_script_name;
           fastcgi_param QUERY_STRING       $query_string;
           fastcgi_param REQUEST_METHOD     $request_method;
           fastcgi_param CONTENT_TYPE       $content_type;
           fastcgi_param CONTENT_LENGTH     $content_length;
           fastcgi_param GATEWAY_INTERFACE  CGI/1.1;
           fastcgi_param SERVER_SOFTWARE    nginx;
           fastcgi_param SCRIPT_NAME        $fastcgi_script_name;
           fastcgi_param REQUEST_URI        $request_uri;
           fastcgi_param DOCUMENT_URI       $document_uri;
           fastcgi_param DOCUMENT_ROOT      $document_root;
           fastcgi_param SERVER_PROTOCOL    $server_protocol;
           fastcgi_param REMOTE_ADDR        $remote_addr;
           fastcgi_param REMOTE_PORT        $remote_port;
           fastcgi_param SERVER_ADDR        $server_addr;
           fastcgi_param SERVER_PORT        $server_port;
           fastcgi_param SERVER_NAME        $server_name;
           fastcgi_param HOST_NAME          $host;

           fastcgi_cache_valid  200 302 301  43200m;
           fastcgi_cache_valid  404 401      43200m;
           fastcgi_cache fc3;
           fastcgi_cache_key   $http_host$request_uri;

         }

  }

  server {
        listen 8088;
        server_name 3a3j.com www.3a3j.com;
        location / {
          root  /apps/dat/www/mpf/3a3j.com;
         }
   }

  server {
        listen 8088;
        server_name 3q44.com www.3q44.com;
        location / {
          root  /apps/dat/www/mpf/3q44.com;
         }
   }

  server {
        listen 8088;
        server_name 5h5z.com www.5h5z.com;
        location / {
          root  /apps/dat/www/mpf/5h5z.com;
         }
   }

  server {
        listen 8088;
        server_name 55h2.com www.55h2.com;
        location / {
          root  /apps/dat/www/mpf/55h2.com;
         }
   }


  server {
        listen 8088;
        server_name 5x5t.com www.5x5t.com;
        location / {
          root  /apps/dat/www/mpf/5x5t.com;
         }
   }




#    upstream local_mpf {
#        server 127.0.0.1:8087 weight=1;
#    }
#   server {
#        listen       8087;
        #listen       8088;
#        server_name  *.3a3j.com *.3q44.com *.55h2.com *.5h5z.com *.5x5t.com *.6b6u.com *.8d8k.com *.8u9d.com *.96vb.com *.9ukk.com;
#        error_page   500 502 503 504 http://www.3a3j.com/;
#        location / {
#           gzip off;
#           proxy_set_header Host $http_host;
#           proxy_pass http://local_mpf;

#           proxy_cache_valid  200 302  10m;
#           proxy_cache_valid  404      1m;
#           proxy_cache c3;
#          }
#   }