对接 Seafile 后,用户可以在文件列类型中选择 Seafile 中的文件,也可以把文件转存到 Seafile 中。
在 SeaTable 服务上使用对接 Seafile 时,需要在 Seafile 服务器的 Nginx 服务开上启跨域功能。
1. 开启不做任何限制的跨域请求配置,以 Ubuntu18.04 为例,在 /etc/nginx/sites-available/seafile.conf 添加以下配置;
location / {
add_header Access-Control-Allow-Origin *;
if ($request_method = 'OPTIONS') {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,OPTIONS;
add_header Access-Control-Allow-Headers "deviceType,token, authorization, content-type";
return 204;
}
proxy_pass http://127.0.0.1:8000;
...............
2. 指定一个域名白名单跨域请求配置;
location / {
add_header Access-Control-Allow-Origin http{s}://seatable.com;
if ($request_method = 'OPTIONS') {
add_header Access-Control-Allow-Origin http{s}://seatable.com;
add_header Access-Control-Allow-Methods GET,POST,PUT,DELETE,OPTIONS;
add_header Access-Control-Allow-Headers "deviceType,token, authorization, content-type";
return 204;
}
proxy_pass http://127.0.0.1:8000;
...............
注释: http{s}://seatable.com 是指 SeaTable 服务器URL
3. 检查nginx配置文件语法
nginx -t
4. 重启加载ginx配置文件
nginx -s reload
Last modified by seatable, 2020-12-31