Problem with OnlyOffice. Infinity load file

Hi, everybody. Faced with such a problem. When you open any document, OnlyOffice tries to load the file, but it doesn’t exit. I can’t understand why?..
Example(Not advertising!):
(docx) https://cloud.roffdaniel.com/f/49b1e8bf11ca4cc592e8/
(doc) https://cloud.roffdaniel.com/f/cc9a2287115241949c50/
(xlsx) https://cloud.roffdaniel.com/f/2e001680df7e4ab999d4/
(pptx) https://cloud.roffdaniel.com/f/41ce5593b04d4af882f7/
(ppt) https://cloud.roffdaniel.com/f/fd4e5b6eabe94abcbae7/

Here is nginx conifg:

# Required for OnlyOffice DocumentServer
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;
}

server {
        listen 10.0.30.30:80;
        server_name  cloud.roffdaniel.com;
        rewrite ^ https://$http_host$request_uri? permanent;    # force redirect http to https
        server_tokens off;
}

server {
        listen 10.0.30.30:443 ssl http2;
        ssl_certificate /etc/letsencrypt/live/cloud.roffdaniel.com-0001/fullchain.pem; # managed by Certbot
        ssl_certificate_key /etc/letsencrypt/live/cloud.roffdaniel.com-0001/privkey.pem; # managed by Certbot
        ssl_stapling				on;
        ssl_stapling_verify			on;
        ssl_trusted_certificate		/etc/letsencrypt/live/cloud.roffdaniel.com/chain.pem;
        ssl_dhparam					/etc/letsencrypt/live/cloud.roffdaniel.com/dhparams.pem;

        ssl_session_cache   		shared:SSL:10m;
        ssl_session_timeout 		10m;

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
	    ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-CHACHA20-POLY1305-D:ECDHE-RSA-CHACHA20-POLY1305-D:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-CCM8:ECDHE-ECDSA-AES256-CCM:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-PSK-AES256-CBC-SHA384:RSA-PSK-AES256-CBC-SHA384:DHE-PSK-AES256-CBC-SHA384:PSK-AES256-CBC-SHA384:HIGH';
        server_name cloud.roffdaniel.com;
        proxy_set_header X-Forwarded-For $remote_addr;
        add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
        server_tokens off;

    #
    # seahub
    #
    location / {
        proxy_pass http://10.0.30.30:8083;
		proxy_redirect        off;
		set_real_ip_from 10.0.30.30;
		real_ip_recursive on;
		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-Proto $scheme;
		proxy_pass_header Set-Cookie;

        access_log      /var/log/nginx/seahub.access.log;
        error_log       /var/log/nginx/seahub.error.log;
    }

    #
    # seafile
    #
    location /seafhttp {
        rewrite ^/seafhttp(.*)$ $1 break;
        proxy_pass http://10.0.30.30:8082;
        client_max_body_size 0;
        proxy_connect_timeout  36000s;
        proxy_read_timeout  36000s;
        proxy_send_timeout  36000s;
        send_timeout  36000s;
    }

    #
    # seafdav (webdav)
    #
    # location /seafdav {
    #     fastcgi_pass    10.0.30.30:8080;
    #     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   HTTPS               on;
    #     client_max_body_size 0;
    #     access_log      /var/log/nginx/seafdav.access.log;
    #     error_log       /var/log/nginx/seafdav.error.log;
    # }

    #
    # onlyofficeds
    #
    location /onlyofficeds/ {
        # IMPORTANT ! - Trailing slash !
        proxy_pass http://10.0.30.30:88/;

        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;

        # 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;
    }

    location /media {
        root /usr/share/seafile/seafile-server-latest/seahub;
    }

    large_client_header_buffers 4 32k;
	
	add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
	add_header Content-Security-Policy "block-all-mixed-content";
	add_header X-Frame-Options "SAMEORIGIN";
	add_header X-XSS-Protection "1; mode=block";
	add_header X-Content-Type-Options "nosniff";
}

Thank you in advance!

Have you tried:

location /onlyofficeds/ {
    # IMPORTANT ! - Trailing slash !
    proxy_pass http://127.0.0.1:88/;
1 Like

@mercury Unfortunately, Yes, I did. Not help =(

Your Nginx configuration looks fairly standard but there are some things you’ve added that no doubt customize it for your application. I would go back to the basic plain vanilla configuration found in the Manual, add the OnlyOffice parts, and prove that it works. Once you get it working add your special bits, slowly, and verify after each addition.

The plain vanilla configuration for HTTPS can be found here.

1 Like

@mercury Thank you very much! But, even when using the standard Nginx configuration, OnlyOffice returns an error … =(
# Required for OnlyOffice DocumentServer

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;

}

server {

    listen 10.0.30.30:80;

    server_name  cloud.roffdaniel.com;

    rewrite ^ https://$http_host$request_uri? permanent;    # force redirect http to https

    server_tokens off;

}

server {

    listen 10.0.30.30:443;

    ssl_certificate /etc/letsencrypt/live/cloud.roffdaniel.com-0001/cert.pem;        # path to your cacert.pem

    ssl_certificate_key /etc/letsencrypt/live/cloud.roffdaniel.com-0001/privkey.pem;    # path to your privkey.pem

    server_name cloud.roffdaniel.com;

    ssl_session_timeout 5m;

    ssl_session_cache shared:SSL:10m;

    # Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits

    ssl_dhparam /etc/letsencrypt/live/cloud.roffdaniel.com/dhparams.pem;

    # secure settings (A+ at SSL Labs ssltest at time of writing)

    # see https://wiki.mozilla.org/Security/Server_Side_TLS#Nginx

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

    ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-CAMELLIA256-SHA:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-SEED-SHA:DHE-RSA-CAMELLIA128-SHA:HIGH:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS';

    ssl_prefer_server_ciphers on;

    proxy_set_header X-Forwarded-For $remote_addr;

    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";

    server_tokens off;

    location / {

        proxy_pass         http://10.0.30.30:8083;

        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_set_header   X-Forwarded-Proto https;

        access_log      /var/log/nginx/seahub.access.log;

        error_log       /var/log/nginx/seahub.error.log;

        proxy_read_timeout  1200s;

        client_max_body_size 0;

    }

# If you are using [FastCGI](http://en.wikipedia.org/wiki/FastCGI),

# which is not recommended, you should use the following config for location `/`.

#

#    location / {

#         fastcgi_pass    10.0.30.30:8083;

#         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;

#        fastcgi_read_timeout 36000;

#

#         client_max_body_size 0;

#

#         access_log      /var/log/nginx/seahub.access.log;

#        error_log       /var/log/nginx/seahub.error.log;

#    }

    location /seafhttp {

        rewrite ^/seafhttp(.*)$ $1 break;

        proxy_pass http://10.0.30.30:8082;

        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;

    }

    location /onlyofficeds/ {

        # IMPORTANT ! - Trailing slash !

        proxy_pass http://10.0.30.30:88/;

        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;

        # 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;

    }

    location /media {

        root /usr/share/seafile/seafile-server-latest/seahub;

    }

}

Why do you specify the IP address 10.0.30.30 ?

server {

    listen 10.0.30.30:80;

    server_name  cloud.roffdaniel.com;

And

server {

    listen 10.0.30.30:443;

Both the Seafile Manual and the Community Manual simply show the server listening for ports 80 and 443 with a redirect for 443:

server {    listen       80;    server_name  seafile.example.com;

And

server {    listen 443;    ssl on;
1 Like

@mercury Because my server uses two IP addresses, that is, two network interfaces

Another thing, what about seahub_settings.py? Seafile Manual says:

# Enable Only Office
ENABLE_ONLYOFFICE = True
VERIFY_ONLYOFFICE_CERTIFICATE = False
ONLYOFFICE_APIJS_URL = 'http{s}://{your OnlyOffice server's domain or IP}/web-apps/apps/api/documents/api.js'
ONLYOFFICE_FILE_EXTENSION = ('doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'odt', 'fodt', 'odp', 'fodp', 'ods', 'fods')
ONLYOFFICE_EDIT_FILE_EXTENSION = ('docx', 'pptx', 'xlsx')

I think in your case

ONLYOFFICE_APIJS_URL = 'http{s}://{your OnlyOffice server's domain or IP}/web-apps/apps/api/documents/api.js'

would be

ONLYOFFICE_APIJS_URL = 'https://cloud.roffdaniel.com/web-apps/apps/api/documents/api.js'

1 Like

By the way there is an excellent video (in German) on YouTube that illustrates how to setup Seafile with OnlyOffice.

I watched it a couple times (slowly) before I was able to get OnlyOffice to work.

1 Like

Are you using JWT secret? If so, I would leave that off until you get things running. It is elective.

1 Like

@mercury To the JWT, no, I don’t use it. I’m the only one using the cloud, nobody else. But thank you all the same! To the http{s}. Just tried it, well, and you can try it at the links above. There is an error in the form: https://cloud.roffdaniel.com/f/fd4e5b6eabe94abcbae7/http%7Bs%7D://cloud.roffdaniel.com/onlyofficeds/web-apps/apps/api/documents/api.js

What error are you receiving?

As to the dual ports/addresses, I’m not certain you need to specify the IP at this point. Have you tried without it?

Error 404, file api.js can’t find it. In the browser console, the Network tab shows an error

I tried to do this without specifying a local IP address. The fact is that the server uses several domains with this IP, but different domain names/subdomains(hosts). If I remove the IP, then for some reason the certificate of another domain is used, although I specified the path correctly. I don’t know why…

I’m starting to think this goes beyond Seafile or OnlyOffice. Is it possible it’s a routing issue?

Can you setup a test server on another box, even a laptop or VM, to validate your basic configuration?

Unfortunately, I don’t have the option to do this check on a separate box.

Just now, I removed the local IP addresses and hosts that were interfering. Nothing has changed. You can, again, check the links above

@mercury Hi. I reinstalled Seafile on a new server, now I use CentOS Instead of Ubuntu. The problem is still the same… The file doesn’t load. Please help me =(

Sure thing.

Does this server have a single IP address?

Is this Seafile CE or Pro? Version?

Can you provide a diagram or sketch of your network in case there are any external issues to address?

Yes, server single IP

CE

What do you mean? Well, I can open the test page by http://10.0.30.35/welcome/
systemd 1 root 34u IPv4 18425 0t0 TCP *:111 (LISTEN)
systemd 1 root 36u IPv6 18427 0t0 TCP *:111 (LISTEN)
rpcbind 746 rpc 4u IPv4 18425 0t0 TCP *:111 (LISTEN)
rpcbind 746 rpc 6u IPv6 18427 0t0 TCP *:111 (LISTEN)
sshd 850 root 5u IPv4 25013 0t0 TCP *:22 (LISTEN)
sshd 850 root 7u IPv6 25022 0t0 TCP *:22 (LISTEN)
beam.smp 851 rabbitmq 83u IPv4 28768 0t0 TCP *:25672 (LISTEN)
beam.smp 851 rabbitmq 98u IPv4 28804 0t0 TCP 127.0.0.1:5672 (LISTEN)
redis-ser 854 redis 6u IPv4 25665 0t0 TCP 127.0.0.1:6379 (LISTEN)
seaf-serv 939 root 16u IPv4 25259 0t0 TCP *:8082 (LISTEN)
epmd 1508 rabbitmq 3u IPv4 28731 0t0 TCP 127.0.0.1:4369 (LISTEN)
epmd 1508 rabbitmq 4u IPv6 28732 0t0 TCP [::1]:4369 (LISTEN)
python3 1560 root 6u IPv4 28059 0t0 TCP *:8083 (LISTEN)
python3 1565 root 6u IPv4 28059 0t0 TCP *:8083 (LISTEN)
python3 1566 root 6u IPv4 28059 0t0 TCP *:8083 (LISTEN)
python3 1567 root 6u IPv4 28059 0t0 TCP *:8083 (LISTEN)
python3 1568 root 6u IPv4 28059 0t0 TCP *:8083 (LISTEN)
python3 1569 root 6u IPv4 28059 0t0 TCP *:8083 (LISTEN)
nginx 2421 root 10u IPv4 33257 0t0 TCP *:80 (LISTEN)
nginx 2421 root 11u IPv6 33258 0t0 TCP *:80 (LISTEN)
nginx 2422 nginx 10u IPv4 33257 0t0 TCP *:80 (LISTEN)
nginx 2422 nginx 11u IPv6 33258 0t0 TCP *:80 (LISTEN)
nginx 2423 nginx 10u IPv4 33257 0t0 TCP *:80 (LISTEN)
nginx 2423 nginx 11u IPv6 33258 0t0 TCP *:80 (LISTEN)
docservic 3243 ds 21u IPv6 36794 0t0 TCP *:8000 (LISTEN)
spellchec 3245 ds 20u IPv6 37340 0t0 TCP *:8080 (LISTEN)
statsd 3246 ds 20u IPv6 36767 0t0 TCP *:8126 (LISTEN)
example 3247 ds 19u IPv6 36795 0t0 TCP *:3000 (LISTEN)

[root@cloud ~]# firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens18
  sources:
  services: cockpit dhcpv6-client ssh
  ports: 8083/tcp 8082/tcp 10001/tcp 12001/tcp 80/tcp 8000/tcp
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:

Do you have a normal manual for installing Seafile + ONLYOFFICE? I’m starting to wonder if I’m doing something right…

I would start by getting a plain vanilla Seafile running in every respect before applying OnlyOffice. I found OnlyOffice difficult to get working with Seafile even though I had previously installed and managed a standalone OnlyOffice server for a customer. As an aside, I was never able to get OnlyOffice running on Seafile without an SSL certificate so maybe in your case “plain vanilla” means SSL too which is not a big deal these days.

As to the question of manuals, there are two that I know. The official Seafile Manual and the Community Manual. I think you will need to refer to both. As far as I know you will get a working server from either but I cannot attest to the completeness of either at this time so maybe I should qualify the statement and say “As far as I know you will get a working server from either if you persist long enough.”

I would like to say that there is a viable Docker option for Seafile but I don’t have any recent experience with the Docker image to say one way or the other whether if it will be fruitful. I did install a couple Docker servers a while back when it was still pretty green and although the servers did work OnlyOffice was not a feature (I’m not certain it was supported at the time). From what I’ve read here people are still wrestling with the Docker install so if you are interested in going that route read up on all the posts and try to get a fix on what works and where the issues are.

Another thing, if you are planning on using a Raspberry Pi that is also a specialty topic in my opinion.

For a safe easy low-risk install I would use Ubuntu 18.04 or 20.04 LTS with Nginx on an Intel box with its own internal storage.

I can look back over my notes and see if I can come up with something a little more procedural. My recent recollection is that since Seafile 7 debuted python3 packages and dependencies have been a big issue and stumbling block (but maybe that’s just for people who are upgrading). That should be retired right up front as part of the basic server installation.

1 Like

To the certificate account. Are you talking about a certificate for a domain? I have a certificate from LEA. Will it work?