Self Hosting

Integrating OnlyOffice with Filestash: A Troubleshooting Guide

Setting up OnlyOffice with Filestash for seamless document editing can sometimes be tricky. This guide walks through common hurdles and offers solutions for a smoother integration experience, especially for those running each service on separate Linux Containers (LXC) with NGINX as a reverse proxy.

The Common Stumbling Block: “Can’t Reach the OnlyOffice Server”

One frequent issue encountered is the frustrating “Can’t reach the OnlyOffice server” error. This typically arises when Filestash attempts to load the OnlyOffice api.js file from its own server address instead of the correctly configured OnlyOffice server. This problem is often exacerbated when using a reverse proxy.

While some older workarounds involved modifying plugin files, these solutions are no longer viable due to recent security updates within Filestash. So, what’s the correct approach?

Understanding the Reverse Proxy Configuration

The key lies in properly configuring your NGINX reverse proxy. The reverse proxy needs to correctly forward requests for the OnlyOffice api.js file to the OnlyOffice server. Misconfigurations here can lead Filestash to look in the wrong place for this crucial file.

Troubleshooting Steps

  • Verify Plugin Installation: Ensure the plg_editor_onlyoffice plugin is correctly installed and listed on the Filestash /about page.
  • Double-Check OnlyOffice Server Address: Confirm the OnlyOffice server address is accurately entered in the Filestash admin settings. Typos are a common culprit.
  • Inspect NGINX Configuration: Carefully review your NGINX configuration file. Pay close attention to the proxy pass directives for both Filestash and OnlyOffice. Ensure the paths for OnlyOffice resources, including api.js, are correctly proxied to the OnlyOffice server.
  • Examine Browser Console: Use your browser’s developer tools (usually accessed by pressing F12) to inspect the network requests. Look for any 404 errors related to api.js. This will pinpoint whether the request is being sent to the correct server.
  • Test Direct Access: Temporarily bypass the reverse proxy and try accessing both Filestash and OnlyOffice directly using their IP addresses and ports. This helps isolate whether the issue lies within the reverse proxy configuration or elsewhere.

Example NGINX Configuration Snippet

While specific configurations vary, here’s a simplified example to illustrate proper proxying:


location /onlyoffice/ {
    proxy_pass http://your_onlyoffice_server:port/;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location / {
    proxy_pass http://your_filestash_server:port/;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

Remember to replace your_onlyoffice_server and your_filestash_server with the appropriate IP addresses or domain names, and adjust the ports accordingly.

Community Support

If you’re still facing challenges, don’t hesitate to seek help. The Filestash community and forums are valuable resources for finding solutions to specific configuration issues.

By systematically checking these areas, you can effectively troubleshoot the “Can’t reach the OnlyOffice server” error and enjoy the seamless integration of OnlyOffice with your Filestash instance.

Leave a Reply

Your email address will not be published. Required fields are marked *