OnlyOffice integration as SNAP

Hello community,

I am looking for some support to analyze my issue with the OnlyOffice integration.

I installed seafile manually with nginx. Everything is working fine and for testing purpose I am working with HTTP only.
Now I installed OnlyOffice on the same host but as SNAP package. I am not a big fan of docker so I’d like to give it a try.

After the SNAP installation I had the first issues, seafile was no longer available.
The reason was that the SNAP package uses the same tcp ports as seafile by default does.
So I fixed this and now I can reach seafile and the welcome page of OnlyOffice.

But if I try to open a DOC document I only get a blank page.
I think something is messed up in nginx but I copy & pasted from the manual and changed the needed ports.

Maybe someone of you have tried the same or has a good idea what I am doing wrong.


Technical information:
Seafile-Nginx listener:
Seafile-SQL listener:
Seafile-Gunicorn listener:
OnlyOffice-Nginx(SNAP) listener:

USER_NAME = Seafile-Cloud
ID = 1e8011807e528cba2191ea587f4bde0ab50a17c6
NAME = Seafile-Cloud

PORT = 13419

ENGINE = mysql
PORT = 3306
USER = seafile
PASSWD = password
DB = ccnet-db
import os

daemon = True
workers = 5

# default localhost:8000
#bind = ""
bind = ""

# Pid
pids_dir = '/opt/haiwen/pids'
pidfile = os.path.join(pids_dir, '')

# for file upload, we need a longer timeout value (default is only 30s, too short)
timeout = 1200

limit_request_line = 8190
# -*- coding: utf-8 -*-
SECRET_KEY = "du)r0g#0yu_x-f2yngv2&)v$j-pptuhcys^0bwnc9oa(-$8x7k"
# Enable Only Office
ONLYOFFICE_FILE_EXTENSION = ('doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'odt', 'fodt', 'odp', 'fodp', 'ods', 'fods')
ONLYOFFICE_EDIT_FILE_EXTENSION = ('docx', 'pptx', 'xlsx')

    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'seahub-db',
        'USER': 'seafile',
        'PASSWORD': 'password',
        'HOST': '',
        'PORT': '3306'
Seafile-Nginx conf
# Required for only office document server
map $http_x_forwarded_proto $the_scheme {
        default $http_x_forwarded_proto;
        "" $scheme;
map $http_x_forwarded_host $the_host {
        default $http_x_forwarded_host;
        "" $host;
map $http_upgrade $proxy_connection {
        default upgrade;
        "" close;
log_format seafileformat '$http_x_forwarded_for $remote_addr [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $upstream_response_time';
server {
    listen 80;
    proxy_set_header X-Forwarded-For $remote_addr;
    location / {
         proxy_pass         HTTP;
         proxy_set_header   Host $host;
         proxy_set_header   X-Real-IP $remote_addr;
         proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header   X-Forwarded-Host $server_name;
         proxy_read_timeout  1200s;
         # used for view/edit office file via Office Online Server
         client_max_body_size 0;
         access_log      /var/log/nginx/seahub.access.log seafileformat;
         error_log       /var/log/nginx/seahub.error.log;
    location /seafhttp {
        rewrite ^/seafhttp(.*)$ $1 break;
        proxy_pass HTTP;
        client_max_body_size 0;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_connect_timeout  36000s;
        proxy_read_timeout  36000s;
        proxy_send_timeout  36000s;
        send_timeout  36000s;
        access_log      /var/log/nginx/seafhttp.access.log seafileformat;
        error_log       /var/log/nginx/seafhttp.error.log;
    location /media {
        root /opt/haiwen/seafile-server-latest/seahub;
    location /onlyofficeds/ {
        # THIS ONE IS IMPORTANT ! - Trailing slash !
        proxy_pass HTTP;
        proxy_http_version 1.1;
        client_max_body_size 100M; # Limit Document size to 100MB
        proxy_read_timeout 3600s;
        proxy_connect_timeout 3600s;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $proxy_connection;
        # THIS ONE IS IMPORTANT ! - Subfolder and NO trailing slash !
        proxy_set_header X-Forwarded-Host $the_host/onlyofficeds;
        proxy_set_header X-Forwarded-Proto $the_scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

Welcome to the Seafile Community Forum! Let me try to help you.

Please try to call

If you receive the answer “Document Server is running”, you’re 99% there.

add “/onlyofficeds” behind “” (should then be ‘HTTP’

Good luck

Hello rdb,

thank you for your fast reply.
If I try to call the URL I receive a page in Seafiles web design telling me that the site was not found.
Moreover the URL is changed to:

When I call I get the correct welcome page for OnlyOffice.

Did you try the rest?

Hold on: and did not yield the same result? Did you restart nginx after the modification? But it should because the folder /onlyoffice is proxy passed to port 8888 according to your Nginx conf.

Please execute:
nginx -t
nginx -s reload

Apologies! It was late yesterday evening. Since /onlyofficeds is proxy-passed to port 8888 by Nginx, my recommendation from yesterday night was not correct. The port has to disappear from the URL.

I restarted nginx and the config file is tested without any errors.

But I find a mistake by myself: -> gives me the “not found” page -> shows the correct welcome page of OnlyOffice
So I missed the trailing / while opening the URL.

Now I tried your other change too and switched from:

I think this is what you mean with our last comment, don’t you?
Just for fun I also tried the following line:

After doing the change I always stopped and started seafile and seahub.

Sadly I still get the blank page if I try to open the document.
Maybe it is useful to mention how the accessed URL for the document looks like:

Thank you for your help :slight_smile:

I tried to open the DOC again while having the chrome developer console open:
The console prints that the following file cannot be loaded:

That’s true instead of is required, than I can open the JS file.

This is fine.


Not sure what you mean by this?

I made a screenshot so that you can see what I have done:

In the developer console at the bottom you can see that the page tries to access the URL:

But the browser cannot access If I change with my seafile server IP address than the JS file is loaded.

Could this be the issue?

Yes I got it running.

I changed:

Because of this my client was able to load the api.js file from the screenshot above and I can see and edit the document.

This means that the ONLYOFFICE_APIJS_URL variable always needs the public IP/Domain of my server. Is this right and the intendet behavior?

Glad to hear that it works now.

Re. your question: The manual states under the headline “Config Seafile and OnlyOffice in the same machine”:

After the installation process is finished, visit this page to make sure you have deployed OnlyOffice successfully: `http{s}://{your Seafile Server's domain or IP}/{your subdolder}/welcome` , you will get **Document Server is running** info at this page.

Actually, the doesn’t say “http{s}://localhost” but if refers explicitly to domain or IP. For some reason localhost does not seem to work. So I guess it is intended.


Thank you again for your help. :slight_smile:

i try to install snap too, but have an error, Something went wrong during installation. i change port of snap mysql to 3307, change port og snap nginx to 8888.