New Seafile Docking Installation

Hi All,

I’ve installed Seafiles on a minimum NixOS server with docker and its working great(pro edition). However I have one small issue regarding mark down files. If I create a md file on my local machine and sync back to Seafile’s using the sync client, this works perfectly. But when I log into the browser and create a new markdown file and edit then click on the save button, its error with “Failed to Save”. All other formats are working and saving correctly. I can create .sdoc files no problem and it edits and save correctly. Its only seem to be the mark down files that I can’t edit, either in the browser or on my iPhone. Has any one had a similar issue?

Kind Regards,

John

Here are some analysis and suggesions to your problem:

Potential Root Causes

  1. Incorrect Hostname or Protocol Configuration: The online Markdown editor depends on the server correctly generating an upload URL. In a new Docker-based installation, if SEAFILE_SERVER_HOSTNAME or SEAFILE_SERVER_PROTOCOL in your .env file are misconfigured (e.g., set to http while using https), the editor cannot communicate with the file server component to save changes.
  2. CSRF or Proxy Header Mismatches: Since you are using NixOS with Docker, there may be a configuration issue in your reverse proxy (Nginx, Caddy, etc.). If headers like X-Forwarded-Proto are not correctly passed as https, the browser may block the save request due to security policies (CSRF protection), even if other features seem to work.
  3. Container Communication/DNS: On NixOS, Docker networking can sometimes be restrictive. If the Seafiles container needs to resolve its own SEAFILE_SERVER_HOSTNAME to complete the save process and cannot reach its own external address, the save will fail.

Recommended Troubleshooting Steps

  1. Inspect Browser Console: Open the browser’s developer tools (F12) while trying to save the Markdown file. Look for failed network requests (403, 404, or 500 errors). Check if the URL being called matches your external domain and uses the correct protocol (https vs http).
  2. Verify .env Configuration: Double-check your Docker environment variables:
  • SEAFILE_SERVER_HOSTNAME: Must match your domain (e.g., seafile.example.com).
  • SEAFILE_SERVER_PROTOCOL: Must be https if you are accessing the site via SSL.
  1. Reverse Proxy Check: Ensure your NixOS reverse proxy is passing the following headers to the Seafile container:
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;

Incorrect headers are a frequent cause of “Failed to Save” errors in web-based editors.

1 Like

Many thanks Dan, the nixos server is all setup and working. I appreciate the message and the quick response.