{"action":"created","issue":{"url":"https://api.github.com/repos/haiwen/seafile/issues/1090","labels_url":"https://api.github.com/repos/haiwen/seafile/issues/1090/labels{/name}","comments_url":"https://api.github.com/repos/haiwen/seafile/issues/1090/comments","events_url":"https://api.github.com/repos/haiwen/seafile/issues/1090/events","html_url":"https://github.com/haiwen/seafile/issues/1090","id":58211180,"number":1090,"title":"Fileserver not working properly with HTTPS - Max download size ~80KB","user":{"login":"Jip-Hop","id":2871973,"avatar_url":"https://avatars.githubusercontent.com/u/2871973?v=3","gravatar_id":"","url":"https://api.github.com/users/Jip-Hop","html_url":"https://github.com/Jip-Hop","followers_url":"https://api.github.com/users/Jip-Hop/followers","following_url":"https://api.github.com/users/Jip-Hop/following{/other_user}","gists_url":"https://api.github.com/users/Jip-Hop/gists{/gist_id}","starred_url":"https://api.github.com/users/Jip-Hop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jip-Hop/subscriptions","organizations_url":"https://api.github.com/users/Jip-Hop/orgs","repos_url":"https://api.github.com/users/Jip-Hop/repos","events_url":"https://api.github.com/users/Jip-Hop/events{/privacy}","received_events_url":"https://api.github.com/users/Jip-Hop/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-02-19T13:59:33Z","updated_at":"2015-02-19T15:53:02Z","closed_at":null,"body":"I have configured Seafile to use HTTPS following the manual with a non standard port. I can browse the Seahub web interface over HTTPS, I can upload large files. But I can only download very small files from the Seahub web interface. The largest file I was been able to download is 79KB.\r\n\r\nImage corrupt or truncated: https://mydomain.com:customport/seafhttp/files/string/image.JPG\r\n![schermafbeelding 2015-02-19 om 14 54 32](https://cloud.githubusercontent.com/assets/2871973/6267769/46858b22-b847-11e4-8da8-a3d3580fb662.png)\r\nAs you can see the image only loads partly.\r\n\r\nThis is my nginx config where customport is the port I use for HTTPS and mydomain.com is the domain I host Seafile on.\r\n\r\n```\r\nserver {\r\n        listen       80;\r\n        server_name  mydomain.com;\r\n        rewrite ^ https://$http_host$request_uri? permanent;    # force redirect http to https\r\n}\r\nserver {\r\n        listen customport;\r\n        ssl on;\r\n        ssl_certificate /etc/ssl/cacert.pem;            # path to your cacert.pem\r\n        ssl_certificate_key /etc/ssl/privkey.pem;    # path to your privkey.pem\r\n        server_name mydomain.com;\r\n        location / {\r\n                fastcgi_pass    127.0.0.1:8000;\r\n                fastcgi_param   SCRIPT_FILENAME     $document_root$fastcgi_script_name;\r\n                fastcgi_param   PATH_INFO           $fastcgi_script_name;\r\n\r\n                fastcgi_param   SERVER_PROTOCOL    $server_protocol;\r\n                fastcgi_param   QUERY_STRING        $query_string;\r\n                fastcgi_param   REQUEST_METHOD      $request_method;\r\n                fastcgi_param   CONTENT_TYPE        $content_type;\r\n                fastcgi_param   CONTENT_LENGTH      $content_length;\r\n                fastcgi_param   SERVER_ADDR         $server_addr;\r\n                fastcgi_param   SERVER_PORT         $server_port;\r\n                fastcgi_param   SERVER_NAME         $server_name;\r\n                fastcgi_param   HTTPS               on;\r\n                fastcgi_param   HTTP_SCHEME         https;\r\n\r\n                access_log      /mnt/seafile-install/logs/seahub.access.log;\r\n                error_log       /mnt/seafile-install/logs/seahub.error.log;\r\n        }\r\n        location /seafhttp {\r\n                rewrite ^/seafhttp(.*)$ $1 break;\r\n                proxy_pass http://127.0.0.1:8082;\r\n                client_max_body_size 0;\r\n                proxy_connect_timeout  36000s;\r\n                proxy_read_timeout  36000s;\r\n        }\r\n        location /media {\r\n                root /mnt/seafile-install/seafile-server-latest/seahub;\r\n        }\r\n}\r\n```\r\n\r\nIn the seahub_settings.py I have the following\r\n```\r\n...some rules...\r\n# This line breaks file download\r\nFILE_SERVER_ROOT = 'https://mydomain.com:customport/seafhttp'\r\n...some rules...\r\n```\r\nWith that entry in the seahub_settings.py my download requests go to:\r\nhttps://mydomain.com:customport/seafhttp/files/string/filename.ext\r\nThat doesn't work very well for downloading.\r\n\r\nWithout that entry in seahub_settings.py my download requests go to http://mydomain.com:8082/files/string/filename.ext\r\nNote that this is over http, not https and requires an additional port to be opened.\r\nThe strange thing however, is that this does work! I can download files properly, however not over HTTPS.\r\n\r\nI notice a few things. The difference between the two scenarios is the port and protocol used. But there is also something different with the URL that is being requested. The one that works requests http://domain:port/files/... while the one that doens't work well requests https://domain:port/seafhttp/files/...\r\n\r\nWhy is this happening when I configure HTTPS?"},"comment":{"url":"https://api.github.com/repos/haiwen/seafile/issues/comments/75075944","html_url":"https://github.com/haiwen/seafile/issues/1090#issuecomment-75075944","issue_url":"https://api.github.com/repos/haiwen/seafile/issues/1090","id":75075944,"user":{"login":"shoeper","id":5340585,"avatar_url":"https://avatars.githubusercontent.com/u/5340585?v=3","gravatar_id":"","url":"https://api.github.com/users/shoeper","html_url":"https://github.com/shoeper","followers_url":"https://api.github.com/users/shoeper/followers","following_url":"https://api.github.com/users/shoeper/following{/other_user}","gists_url":"https://api.github.com/users/shoeper/gists{/gist_id}","starred_url":"https://api.github.com/users/shoeper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shoeper/subscriptions","organizations_url":"https://api.github.com/users/shoeper/orgs","repos_url":"https://api.github.com/users/shoeper/repos","events_url":"https://api.github.com/users/shoeper/events{/privacy}","received_events_url":"https://api.github.com/users/shoeper/received_events","type":"User","site_admin":false},"created_at":"2015-02-19T15:53:02Z","updated_at":"2015-02-19T15:53:02Z","body":"Ok hardware is fine (there are just some people out using a raspi and expect to have a nice performance).\r\n\r\nWhat about the http error code in the browser? (response code is not on the screenshot)\r\nAnd did you try increasing `proxy_send_timeout`? (http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_send_timeout)\r\n\r\nAnd have a look at your nginx log."}}