seafile版本:seafile-server-7.05
nginx版本:nginx-1.9.9
nginx配置信息
1 user root; 2 worker_processes 1; 3 4 # error_log logs/error.log; 5 #error_log logs/error.log notice; 6 #error_log logs/error.log info; 7 error_log logs/error.log warn; 8 9 pid logs/nginx.pid; 10 11 events { 12 #每个进程最大连接数,默认为512 13 worker_connections 512; 14 #设置一个进程是否同时接受多个网络连接 15 multi_accept on; 16 #设置网路连接序列化,防止惊群现象发生 17 accept_mutex on; 18 # 线程轮询方式 19 use epoll; 20 } 21 22 23 http { 24 include mime.types; 25 26 # 指定默认处理的文件类型可以是二进制 27 default_type application/octet-stream; 28 29 # 自定义日志格式 30 log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 31 '$status $body_bytes_sent "$http_referer" ' 32 '"$http_user_agent" "$http_x_forwarded_for"'; 33 access_log logs/access.log main; 34 35 sendfile on; 36 #tcp_nopush on; 37 # 连接超时时间 38 keepalive_timeout 50; 39 40 # 采用gzip压缩的形式发送数据 41 gzip on; 42 # 隐藏nginx版本号 43 server_tokens off; 44 45 server { 46 listen 80; 47 server_name www.xxx.com; 48 49 rewrite ^(.*)$ https://$host$1 permanent; 50 # location / { 51 # root html; 52 # index index.html; 53 # } 54 #error_page 404 /404.html; 55 56 # redirect server error pages to the static page /50x.html 57 # 58 # error_page 500 502 503 504 /50x.html; 59 # location = /50x.html { 60 # root html; 61 # } 62 } 63 64 server { 65 listen 443 ssl; #SSL协议访问端口号为443。此处如未添加ssl,可能会造成Nginx无法启动。 66 server_name www.xxx.com; #将localhost修改为您证书绑定的域名,例如:www.example.com。 67 68 ssl_certificate cert/www.xxx.com.pem; #将domain name.pem替换成您证书的文件名。 69 ssl_certificate_key cert/www.xxx.com.key; #将domain name.key替换成您证书的密钥文件名。 70 ssl_session_timeout 5m; 71 ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; #使用此加密套件。 72 ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #使用该协议进行配置。 73 ssl_prefer_server_ciphers on; 74 75 # location / { 76 # root html; #站点目录。 77 # index index.html; 78 # } 79 80 location / { 81 proxy_pass http://127.0.0.1:8000; 82 83 proxy_set_header Host $host; 84 proxy_set_header X-Real-IP $remote_addr; 85 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 86 proxy_set_header X-Forwarded-Host $server_name; 87 proxy_set_header X-Forwarded-Proto https; 88 89 access_log /var/log/nginx/seahub.access.log; 90 error_log /var/log/nginx/seahub.error.log; 91 proxy_read_timeout 1200s; 92 93 client_max_body_size 0; 94 } 95 96 location /seafhttp { 97 rewrite ^/seafhttp(.*)$ $1 break; 98 proxy_pass http://127.0.0.1:8082; 99 client_max_body_size 0; 100 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 101 proxy_connect_timeout 36000s; 102 proxy_read_timeout 36000s; 103 proxy_send_timeout 36000s; 104 send_timeout 36000s; 105 } 106 107 location /media { 108 root /usr/local/seafile/seafile-server-7.0.5/seahub; 109 } 110 } 111 }
seafile 配置信息
cd /usr/local/seafile/conf
修改ccnet.conf文件
[General] USER_NAME = seafile ID = 3e63b3eb265101c60c6554a8d923d081375fb7eb NAME = seafile SERVICE_URL = https://www.xxx.com [Client] PORT = 13419 [Database] ENGINE = mysql HOST = 127.0.0.1 PORT = 3306 USER = wang PASSWD = 123456 DB = seafile_db CONNECTION_CHARSET = utf8
登录网站www.xxx.com
修改SERVICE_URL、FILE_SERVER_ROOT
配置完成!