Nextcloud + Onlyoffice beyond nginx reverse proxy

Hi,
I’m running my NC 18 with OO on the same Proxmox-LXC. On another LXC I’m running my nginx reverse-proxy.
NC 18 works fine and inside LAN without the reverse proxy OO is working good as well. But after setting my cloud online behind my reverse proxy, OO won’t work anymore. I think I have something missing in my reverse proxy setting. May some of you find the problem?

This is my configuration on my reverse proxy:
map $http_upgrade $connection_upgrade {
default upgrade;
‘’ close;
}

server {
listen 80;
server_name nextcloud.com;
return 301 https://$host$request_uri;
}

SSL configuration

server {
listen 443 ssl;
server_name nextcloud.com;
ssl_certificate /etc/letsencrypt/live/nextcloud.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/nextcloud.com/privkey.pem;

Improve HTTPS performance with session resumption

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

Enable server-side protection against BEAST attacks

ssl_prefer_server_ciphers on;
ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:!ADH:!AECDH:!MD5;

Disable SSLv3

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

Diffie-Hellman parameter for DHE ciphersuites

ssl_dhparam /etc/ssl/certs/dhparam.pem;

Enable HSTS (https://developer.mozilla.org/en-US/docs/Security/HTTP_Strict_Transport_Security)

add_header Strict-Transport-Security “max-age=63072000; includeSubdomains”;

Enable OCSP stapling (http://blog.mozilla.org/security/2013/07/29/ocsp-stapling-in-firefox)

ssl_stapling on;
ssl_stapling_verify on;
ssl_trusted_certificate /etc/letsencrypt/live/nextcloud.com/fullchain.pem;
resolver 192.168.0.13 192.168…1 valid=600s;
resolver_timeout 15s;

location / {
proxy_pass https://192.168.0.2:443;
proxy_set_header Host $host;
proxy_redirect http:// $scheme://; #https://;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Connection $connection_upgrade;

noone? Am I the only one running NC behind a reverse proxy VM?

Hello,
I’m running nextcloud 18.0.1 behind an nginx proxy too. I does not work after activating the proxy, I have to update the OpenOffice configuration in Nextcloud to the new https address and it start working again.
The first time you install the documentserver it automatically set the server address, but it point to the internal address. Verify it is using the public address.

it is the public adress. but still nothing.

What do you mean with the internal address?

I am also using nextcloud behind a reverse proxy and I also got problems to open files.

Hi @mpi_franz, the app OnlyOffice setup automatically the IP address of the Server after install. But it just detect the local IP, not the public IP.

Captura%20de%20pantalla%20de%202020-03-04%2011-02-49

Make shure the Document Editing Service address is the public FQDN (with https).
Something like this https://nc.company.org/nextcloud/index.php/apps/documentserver_community/.

I have the public address in there but when I click save I get the cURL error 60.

Do I need to set some special proxy settings?

https://docs.nextcloud.com/server/16/admin_manual/configuration_server/config_sample_php_parameters.html?highlight=overwrite%20cli%20url#proxy-configurations

I got similar trouble with a similar set-up. It was caused by networking issues.
Issue description :
check which certificate is shown when you connect nextcloud to document server. If it receives the router’s certificate instead of the documents server’s, try the resolution above. Otherwise, that’s another issue.

resolution ;
simply bind your FQDN to internal IP in your router’s DNS.