打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Config Seahub with Nginx · Seafile Server Manual

Config Seahub with Nginx

Deploy Seahub/FileServer with Nginx

Seahub is the web interface of Seafile server. FileServer is used to handle raw file uploading/downloading through browsers. By default, it listens on port 8082 for HTTP requests.

1

Here we deploy Seahub using FastCGI, and deploy FileServer with a reverse proxy. We assume you are running Seahub using domain seafile.example.com.

+

This is a sample Nginx config file.

+

In Ubuntu 14.04, you can add the config file as follows:

+
  1. create file /etc/nginx/sites-available/seafile.conf
  2. Delete /etc/nginx/sites-enabled/default: rm /etc/nginx/sites-enabled/default
  3. Create symbolic link: ln -s /etc/nginx/sites-available/seafile.conf /etc/nginx/sites-enabled/seafile.conf
server {    listen 80;    server_name seafile.example.com;    proxy_set_header X-Forwarded-For $remote_addr;    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;        fastcgi_read_timeout 36000;    }    location /seafhttp {        rewrite ^/seafhttp(.*)$ $1 break;        proxy_pass http://127.0.0.1:8082;        client_max_body_size 0;        proxy_connect_timeout  36000s;        proxy_read_timeout  36000s;        proxy_send_timeout  36000s;        send_timeout  36000s;    }    location /media {        root /home/user/haiwen/seafile-server-latest/seahub;    }}

Nginx settings client_max_body_size is by default 1M. Uploading a file bigger than this limit will give you an error message HTTP error code 413 ("Request Entity Too Large").

+

You should use 0 to disable this feature or write the same value than for the parameter max_upload_size in section [fileserver] of seafile.conf. Client uploads are only partly effected by this limit. With a limit of 100 MiB they can safely upload files of any size.

+

Tip for uploading very large files (> 4GB): By default Nginx will buffer large request bodies in temp files. After the body is completely received, Nginx will send the body to the upstream server (seaf-server in our case). But it seems when the file size is very large, the buffering mechanism dosen't work well. It may stop proxying the body in the middle. So if you want to support file uploads larger than 4GB, we suggest to install Nginx version >= 1.8.0 and add the following options to Nginx config file:

+
    location /seafhttp {        ... ...        proxy_request_buffering off;    }

Modify ccnet.conf and seahub_setting.py

Modify ccnet.conf

You need to modify the value of SERVICE_URL in ccnet.conf to let Seafile know the domain, protocol and port you choose. You can also modify SERVICE_URL via web UI in "System Admin->Settings". (Warning: If you set the value both via Web UI and ccnet.conf, the setting via Web UI will take precedence.)

+
SERVICE_URL = http://seafile.example.com

Note: If you later change the domain assigned to Seahub, you also need to change the value of SERVICE_URL.

+

Modify seahub_settings.py

You need to add a line in seahub_settings.py to set the value of FILE_SERVER_ROOT. You can also modify FILE_SERVER_ROOT via web UI in "System Admin->Settings". (Warning: if you set the value both via Web UI and seahub_settings.py, the setting via Web UI will take precedence.)

+
FILE_SERVER_ROOT = 'http://seafile.example.com/seafhttp'

Start Seafile and Seahub

./seafile.sh start./seahub.sh start-fastcgi
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Seafile开源的个人网盘及企业网盘搭建
使用Tornado+Nginx部署Django的一种尝试_应用服务器
nginx[+spawn
Seafile Pro 8 在CentOS 7上的部署
所用端口说明 · Seafile Server Manual
实现动静分离的LNMMP网站架构
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服