Document server + Only office behind nginx reverse proxy

hello all,
trying to install ONLYOFFICE in Nextcloud, following this guide:

i have installed Turnkey’s nextcloud LXC and i use nginx as reverse proxy.
when i go to administration/onlyoffice, i get this error:
Error when trying to connect (Client error: POST https://cloud.xxxx.xx/apps/documentserver_community/coauthoring/CommandService.ashx resulted in a 405 Method Not Allowed response)

my nginx conf is:

server {
server_name nextcloud.xxxxx.xx cloud.xxxxx.xx;
access_log /var/log/nginx/cloud_access.log;
error_log /var/log/nginx/cloud_error.log;
client_max_body_size 10G;
client_body_buffer_size 400M;

location / {
proxy_pass https://10.107.91.105;
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
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 https;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_headers_hash_max_size 512;
proxy_headers_hash_bucket_size 128;
}
location /.well-known/carddav {
return 301 $scheme://$host/remote.php/dav;
}

location /.well-known/caldav {
return 301 $scheme://$host/remote.php/dav;
}

location ^~ /.well-known {
return 301 $scheme://$host/index.php$uri;
}

Hello,

Never used that version but… you may want to consider adding the following to config.php if not already there:

‘trusted_proxies’ => [
‘10.107.91.105’, // Replace with your reverse proxy IP
],

Ensure the “trusted domains” is entered in your config.php:

‘trusted_domains’ => [
‘nextcloud.xxxxx.xx’,
‘cloud.xxxxx.xx’,
],

Your nextcloud only office URL should match that of your externally resolved host name… if you need to resolve your external IP/DNS name from your internal host you may need to consider a NAT hairpin.
Test access from the relevant components that you can curl (or browse to)
/apps/documentserver_community/coauthoring/CommandService.ashx from the installation (test if it “sees itself”).

You could test adding the following to your NGNIX config:
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto https;

You may also need to set a location block for the document server.

the error changed…

RequestException cURL error 60: SSL: no alternative certificate subject name matches target host name ‘nextcloud.solidarit.gr’ (see libcurl - Error Codes) for https://nextcloud.solidarit.gr/apps/documentserver_community/healthcheck

even though the url https://nextcloud.solidarit.gr/apps/documentserver_community/healthcheck returns true

Hi!

I’m not sure but it seems Nextcloud Hub is the commercial offering of Nextcloud? Shouldn’t you be getting commercial support, then?

Anyway, I was triggered because I have the same setup as you. I have 3 linux containers on a proxmox box:

  1. Nginx reverse proxy (from turnkeylinux basic image)
  2. Nextcloud (from turnkeylinux nextcloud image)
  3. OnlyOffice document server (from turnkeylinux basic image)

In Nextcloud I needed to install the ONLYOFFICE app (it’s name ís in capitals on the App page) and I needed to enter the exact, public urls for both the nextcloud and the onlyoffice install in the ONLYOFFICE settings.

The reverse proxy as well as the onlyoffice install must be available to the internet, as I gather.

It worked a treat after that.

I followed the steps on Installing ONLYOFFICE Docs for Debian, Ubuntu, and derivatives - ONLYOFFICE for installing onlyoffice.

My Nginx config is much like yours.

Hope this helps, I can add more info if you want.

i have nextcloud and document server in the same lxc container.
actually installed document server via nextcloud apps.

i cannot understand where is the mistake, on nginx or on nextcloud