简体   繁体   English

即使设置了“ FILE_SERVER_ROOT”变量,Seafile文件也无法上传

[英]Seafile file upload does not work, even after setting the “FILE_SERVER_ROOT” variable

I'm trying to get Seafile running behind a nginx reversed proxy. 我正在尝试让Seafile在Nginx反向代理后面运行。 I followed this: http://manual.seafile.com/deploy/deploy_with_nginx.html along with this: http://manual.seafile.com/deploy/https_with_nginx.html . 我遵循了这个: http : //manual.seafile.com/deploy/deploy_with_nginx.html以及这个: http : //manual.seafile.com/deploy/https_with_nginx.html

My configuration is like follows: 我的配置如下:

  • Nginx running for vhost "cloud.mydomain.tld" Nginx运行虚拟主机“ cloud.mydomain.tld”
  • Seafile and Seahub (in fastcgi mode) both running on their default ports Seafile和Seahub(在fastcgi模式下)都在其默认端口上运行
  • My seahub_settings.py looks like this: 我的seahub_settings.py看起来像这样:

     HTTP_SERVER_ROOT = 'https://cloud.mydomain.tld/seafhttp' -- I added this to try it FILE_SERVER_ROOT = 'https://cloud.mydomain.tld/seafhttp' SECRET_KEY = "12345678-1234-1234-1234-1234567890123456" DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'seahub-db', 'USER': 'seafile', 'PASSWORD': 'mypassword', 'HOST': '127.0.0.1', 'PORT': '3306', 'OPTIONS': { 'init_command': 'SET storage_engine=INNODB', } } } 
  • My nginx configuration: 我的nginx配置:

     ### Cloud ### # No-SSL redirect server { listen 80; server_name cloud.mydomain.tld; return 301 https://$server_name$request_uri; } # SSL server { listen 443 ssl; server_name cloud.mydomain.tld; ssl_certificate /etc/letsencrypt/live/cloud.mydomain.tld/cert.pem; ssl_certificate_key /etc/letsencrypt/live/cloud.mydomain.tld/privkey.pem; 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/cloud/seafile-server-latest/seahub; } } 
  • That should be everything important. 那应该很重要。

So now, when I delete my old seahub_settings.pyc, start seahub (in fastcgi mode, of course), point the browser to my library and try to upload something, I get the following error message in the F12 developer console: 因此,现在,当我删除旧的seahub_settings.pyc,启动seahub(当然是在fastcgi模式下),将浏览器指向我的库并尝试上传内容时,在F12开发人员控制台中收到以下错误消息:

main.ad03aea1e16e.js:215 Mixed Content: The page at 'https://cloud.mydomain.tld/#my-libs/lib/12345678-1234-1234-1234-123456789012' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://cloud.mydomain.tld:8082/upload-aj/12345678-1234-1234-1234-123456789012'. This request has been blocked; the content must be served over HTTPS.
    send @ main.ad03aea1e16e.js:215

This means, that seahub is still trying to connect to the "old" upload service, which of course does not work anymore. 这意味着,seahub仍在尝试连接到“旧的”上传服务,该服务当然不再起作用。 Until now, I did not find out any solution for this problem. 到目前为止,我还没有找到解决该问题的任何方法。

I just found your question by having the same problem. 我只是遇到了同样的问题而找到了您的问题。

That's easy : there's a constance_config in seahub-db (with MySQL, same thing apply with sqlite) that records configuration and overwrite the plain config files. 这很容易:seahub-db中有一个constance_config(对于MySQL,对于sqlite同样适用)记录配置并覆盖纯配置文件。

This configuration can be modified from the admin console (upper right) or you can simply truncate this table to get it re-generated. 您可以从管理控制台(右上)修改此配置,也可以简单地截断该表以重新生成它。

It's a new 'feature' starting from 5.0.0 ( http://manual.seafile.com/config/index.html ). 从5.0.0( http://manual.seafile.com/config/index.html )开始,这是一个新的“功能”。

Regards, Julien 问候,朱利安

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM