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
配置完成!