如何配置seafile以HTTPS運作?

如何配置seafile以HTTPS運作?

我已經在 debian squeeze 上安裝並設定了seafile 1.6.1。預設情況下,它工作在 http、連接埠 8000 上。

為了設定 https,我將這 3 行加入到seafile.conf(https://github.com/haiwen/seafile/wiki/Enable-Https-on-Seafile-web#wiki-Enable_https_on_seafile_httpserver):

https=true
pemfile=/path/seafile-data/conf/cacert.pem
privkey=/path/seafile-data/conf/privkey.pem

ccnet.conf也修改了:

SERVICE_URL = https://mycloud.mydomain.com:8000 

我重新啟動了seafile和seahub。

一旦我輸入這三行,我就無法再獲得登入頁面。我收到超時錯誤訊息。正如我所驗證的,我的客戶端和伺服器之間的連線建立良好。

任何人都會知道問題是什麼?

答案1

我必須正確配置 nginx 才能讓 Seafile 在 https 上運作:

server
{
    listen 443;
    ssl on;
    ssl_certificate /etc/ssl/mycert.crt;    # path to your cacert.pem
    ssl_certificate_key /etc/ssl/mykey.key;     # path to your privkey.pem
    server_name mycloud.example.com;

    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   HTTPS   on;

        access_log      /var/log/nginx/seahub.access.log;
        error_log       /var/log/nginx/seahub.error.log;
    }

    location /media {
        root /data/cloud/seafile-server-1.6.1/seahub;
    }
}

格雷格.

相關內容