OnlyOffice compiled with Mobile Edit Back

On my end I was already using Caddy as a reverse proxy and I just added handle rule in my Caddyfile to rewrite the JS responses for OnlyOffice to enable mobile editing:

https://my.super.domain:443 {
	# Default reverse proxy
	reverse_proxy nextcloud-aio-apache:11000

	# OnlyOffice-specific replacement rules to enable mobile-editing (premium feature)
	handle /onlyoffice/*/web-apps/apps/*/mobile/dist/js/app.js {
		reverse_proxy nextcloud-aio-apache:11000 {
			# Disable compression so replacement can work
			header_up Accept-Encoding identity
		}

		replace {
			match {
				header Content-Type application/javascript*
			}
			isSupportEditFeature=()=>!1 isSupportEditFeature=()=>!0
		}
	}
}

You’ll need to add https://github.com/caddyserver/replace-response in your Caddy instance:

xcaddy build --with github.com/caddyserver/replace-response

I’m sure something similar is possible with NGINX and other reverse proxies but I haven’t tried.

Note: this won’t unlock the 20-connection limit but IMO if you need that then you should pay them, it’s fair to buy it if you use it like that.


I just asked ChatGPT and here is what it recommended for NGINX, I haven’t tried though but someone else could maybe?

server {
   
    ...

    location ~ ^/onlyoffice/.*/web-apps/apps/.*/mobile/dist/js/app\.js$ {
        proxy_pass http://nextcloud-aio-apache:11000;

        # Disable compression so body replacement works
        proxy_set_header Accept-Encoding "";

        sub_filter_types application/javascript;
        sub_filter "isSupportEditFeature=()=>!1" "isSupportEditFeature=()=>!0";
        sub_filter_once off;  # Replace all occurrences, not just the first
    }

You need the ngx_http_sub_module enabled for this to work, but according to ChatGPT it’s shipped by default in most distros, otherwise you can find online how to enable it in NGINX.

I asked and answered myself.
The problem was in the NginX Reverse Proxy configuration.
However, with version 8.3.1 DS worked fine.
I am attaching the final configuration, with which 8.3.3 started.

upstream docserviceadm {
    server 10.214.10.100:8082; 
    keepalive 32;
}


map $http_host $this_host {
    "" $host;
    default $http_host;
}
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;
    "" $this_host;
}
map $http_upgrade $proxy_connection {
  default upgrade;
  "" close;
}

server {
    listen 443 ssl http2;
    server_name ds.example.ru;
    server_tokens off;
    include ssl/ssl.example.ru.conf;
    include .htaccess.conf;

    location / {
        proxy_pass http://docserviceadm;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $proxy_connection;
        proxy_set_header X-Forwarded-Host $the_host;
        proxy_set_header X-Forwarded-Proto $the_scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_buffering off;
    }

    location /doc/ {
        proxy_pass http://docserviceadm/doc/;
        proxy_http_version 1.1;

        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $proxy_connection;
        proxy_set_header X-Forwarded-Host $the_host;
        proxy_set_header X-Forwarded-Proto $the_scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;

    }
}

Hello,
I used to run the dockerized 7.5 version on a Synolkogy NAS. I decided to upgrade to 8.3.3 but get an error :slight_smile:

/app/ds/run-document-server.sh: line 718: [: !=: unary operator expected
nc: port number invalid:
Waiting for connection to the 6379 host on port

and the last message keeps on repeating.
Can you please help ?

Thanks

Laurent.

Hi All.

9.0.4 is out

docker pull ghcr.io/thomisus/onlyoffice-documentserver-unlimited:9.0.4

Could you try if everything works?

Bests

3 Likes

thanks, initial testing, everything seems to work fine

Yep, it seems to work. Thank you for your effort !

working perfectly

Thanks for your continuos effort for providing updated version

Hi All.

9.1.0 is out

docker pull ghcr.io/thomisus/onlyoffice-documentserver-unlimited:9.1.0

or

docker pull thomisus/onlyoffice-documentserver-unlimited:9.1.0

1 Like

I am getting the following error every 24 hrs

my onyoffice server gets disconnected every 24 hrs

i have to open onlyoffice settings in nextcloud and haave to save server settings in order to make it work

Please somebody guide

thanks



{
  "reqId": "rXI8JizxPugmEOQcPLT6",
  "level": 3,
  "time": "2025-11-26T21:40:09+05:30",
  "remoteAddr": "",
  "user": "--",
  "app": "onlyoffice",
  "method": "",
  "url": "--",
  "message": "getConvertedUri on check error",
  "userAgent": "--",
  "version": "32.0.2.2",
  "exception": {
    "Exception": "Exception",
    "Message": "Error occurred in the document service: Error while downloading the document file to be converted.",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/apps/onlyoffice/lib/DocumentService.php",
        "line": 104,
        "function": "processConvServResponceError",
        "class": "OCA\\Onlyoffice\\DocumentService",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/onlyoffice/lib/DocumentService.php",
        "line": 458,
        "function": "getConvertedUri",
        "class": "OCA\\Onlyoffice\\DocumentService",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/onlyoffice/lib/Cron/EditorsCheck.php",
        "line": 169,
        "function": "checkDocServiceUrl",
        "class": "OCA\\Onlyoffice\\DocumentService",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/BackgroundJob/Job.php",
        "line": 61,
        "function": "run",
        "class": "OCA\\Onlyoffice\\Cron\\EditorsCheck",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
        "line": 97,
        "function": "start",
        "class": "OCP\\BackgroundJob\\Job",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
        "line": 84,
        "function": "start",
        "class": "OCP\\BackgroundJob\\TimedJob",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/cron.php",
        "line": 175,
        "function": "execute",
        "class": "OCP\\BackgroundJob\\TimedJob",
        "type": "->"
      }
    ],
    "File": "/var/www/nextcloud/apps/onlyoffice/lib/DocumentService.php",
    "Line": 255,
    "message": "getConvertedUri on check error",
    "exception": [],
    "CustomMessage": "getConvertedUri on check error"
  },
  "id": "6927c228f37bf"
}

Exception Error occurred in the document service: Error while downloading the document file to be converted.

  1. /var/www/nextcloud/apps/onlyoffice/lib/DocumentService.phpLine 104

    OCA\Onlyoffice\DocumentService->processConvServResponceError()
    
  2. /var/www/nextcloud/apps/onlyoffice/lib/DocumentService.phpLine 458

    OCA\Onlyoffice\DocumentService->getConvertedUri()
    
  3. /var/www/nextcloud/apps/onlyoffice/lib/Cron/EditorsCheck.phpLine 169

    OCA\Onlyoffice\DocumentService->checkDocServiceUrl()
    
  4. /var/www/nextcloud/lib/public/BackgroundJob/Job.phpLine 61

    OCA\Onlyoffice\Cron\EditorsCheck->run()
    
  5. /var/www/nextcloud/lib/public/BackgroundJob/TimedJob.phpLine 97

    OCP\BackgroundJob\Job->start()
    
  6. /var/www/nextcloud/lib/public/BackgroundJob/TimedJob.phpLine 84

    OCP\BackgroundJob\TimedJob->start()
    
  7. /var/www/nextcloud/cron.phpLine 175

    OCP\BackgroundJob\TimedJob->execute()
    

After pulling 9.1.0 I’ve the app doesn’t work and I have started to get kernel errors:

docservice[2926997] trap invalid opcode ip:768e86169d83 sp:7fff0404cfe0 error:0 in libvips-cpp.so.42[768e85f55000+a02000]

Is may assume that this is related to the older acrchitecture my PC is using, and the CPU doesn’t support SSE4.2 instruction and other needed for sharp or whatever, see Sharp crashes with invalid opcode in libvips-cpp.so.42 · Issue #3047 · lovell/sharp · GitHub and in particular these two references: Sharp crashes with invalid opcode in libvips-cpp.so.42 · Issue #3047 · lovell/sharp · GitHub and AMD Turion II Neo N54L, Illegal instruction (core dumped) · Issue #3743 · lovell/sharp · GitHub.

My CPU has only these supported flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt nodeid_msr hw_pstate vmmcall npt lbrv svm_lock nrip_save

Can you rebuild the app to make it compatible with older hardware, in particular without specifying sharp as a dependency in its package.json or build custom binaries for sharp with the support of older architectures: all the scripts to do this are open source and available at https://github.com/lovell/sharp-libvips

SSE4.2 was introduced in 2008, which means your CPU is at least 17 years old.

I’m not generally in favor of throwing away hardware that still works, but every 17 years or so, you might need to buy something new, or at least newer. :wink:

Not to mention that even a relatively low-end modern CPU will almost certainly outperform your ancient one, while consuming a fraction of the energy in the process.

Well, my machine works and performs its tasks https://github.com/lovell/sharp/issues/3743

After complaining,

I have stopped and remove onlyoffice and than installed it again and now it’s working

Thanks

I asked DeepSeek :rofl: and have tested it in my Nginx Proxy Manager - works great1
Nextcloud AIO with OnlyOffice.

Advanced tab for host:

location ~ ^/onlyoffice/.+/web-apps/apps/.+/mobile/dist/js/app\.js$ {
    proxy_pass http://4.3.2.222:11000;
    proxy_set_header Accept-Encoding "";
    sub_filter_types application/javascript;
    sub_filter 'isSupportEditFeature=()=>!1' 'isSupportEditFeature=()=>!0';
    sub_filter_once off;
}
1 Like

After last update

Onlyoffice keeps disconnecting and also gives error

Hi All,

new release. Updated to 9.2.1

docker pull ghcr.io/thomisus/onlyoffice-documentserver-unlimited:9.2.1
6 Likes

Impeccable ! Merci !