请问一下不使用php-fpm,使用spawn-fcgi 的配置问题


#1

下载安装了 spawn-fcgi

seafile.conf配置如下

server {

    listen 80;
    server_name my.domain.com;
    rewrite ^ https://$http_host$request_uri? permanent;    # force redirect http to https
    server_tokens off;
    }

server {
listen 443;
ssl on;
ssl_certificate /etc/ssl/cacert.pem; # path to your cacert.pem
ssl_certificate_key /etc/ssl/privkey.pem; #prvkey. path to your privkey.pem
server_name my.domain.com;

  proxy_set_header X-Forwarded-For $remote_addr;
  add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
  server_tokens off;

… fastcgi …

  location / {
      fastcgi_pass    127.0.0.1:8000;
      fastcgi_param   SCRIPT_FILENAME     $document_root$fastcgi_script_name;
      fastcgi_param   PATH_INFO           $fastcgi_script_name;
      fastcgi_param   SERVER_PROTOCOL     $server_protocol;
      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   SERVER_ADDR         $server_addr;
      fastcgi_param   SERVER_PORT         $server_port;
      fastcgi_param   SERVER_NAME         $server_name;
      fastcgi_param   REMOTE_ADDR         $remote_addr;#
      access_log      /var/log/nginx/seahub.access.log;
      error_log       /var/log/nginx/seahub.error.log;
  }

– # location / {# nofastcgi?

–# proxy_pass http://127.0.0.1:8000;
–# proxy_set_header Host $host:4430;
–# proxy_set_header X-Real-IP $remote_addr;
–# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
–# proxy_set_header X-Forwarded-Host $server_name;
–# proxy_set_header X-Forwarded-Proto https;
–# access_log /var/log/nginx/seahub.access.log;
–# error_log /var/log/nginx/seahub.error.log;#
–#

–# proxy_read_timeout 1200s;#

–# client_max_body_size 0;#

–# }
location /seafhttp {

    rewrite ^/seafhttp(.*)$ $1 break;
    proxy_pass http://127.0.0.1:8082;
    client_max_body_size 0;
    proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_connect_timeout  36000s;
    proxy_read_timeout  36000s;
    proxy_send_timeout  36000s;
    send_timeout  36000s;

    }

  location /media {
      root /opt/seafile/seafile-server-latest/seahub;
  }

 location /seafdav {
    fastcgi_pass    127.0.0.1:8080;
    fastcgi_param   SCRIPT_FILENAME     $document_root$fastcgi_script_name;
    fastcgi_param   PATH_INFO           $fastcgi_script_name;
    fastcgi_param   SERVER_PROTOCOL     $server_protocol;
    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   SERVER_ADDR         $server_addr;
    fastcgi_param   SERVER_PORT         $server_port;
    fastcgi_param   SERVER_NAME         $server_name;
    fastcgi_param   REMOTE_ADDR         $remote_addr;
    fastcgi_param   HTTPS               on;
    fastcgi_param   HTTP_SCHEME         https;#
    client_max_body_size 0;
    access_log      /var/log/nginx/seafdav.access.log;
    error_log       /var/log/nginx/seafdav.error.log;

}

}

但是 启动后还是提示
[error] 1506#1506: *783 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.254.179, server: my.domain.com, request: “GET /api2/repos/ HTTP/1.1”, upstream: “fastcgi://127.0.0.1:8000”, host: “192.168.254.19”

将fastcgi部分全部注释不开起则没有问题, 因为没用php 所以不想用 php-fpm ,不知道是不是还缺了什么没有安装


#2

粗体部分 是我注释了的代码 , 发帖自动套用格式 格式就变了