• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

Question Nextcloud extension on Plesk Obsidian working fine, But I cannot figure out how to configure the proxy

bosse1

New Pleskian
Server operating system version
Debian 12
Plesk version and microupdate number
10.0.71
The Apache configuration for the domain under /var/www/vhosts/httpdocs/domain.com is functioning properly, and Nextcloud can open its normal text files without issues. But there is no collaboration without Collabora Office.

The snippet of code below would be the normal configuration if Apache were also being used for the proxy on a non-Plesk server, and can be inserted via the Apache/Nginx additional directives under the https section of Apache.

Code:
# Collabora config:
 AllowEncodedSlashes NoDecode
 ProxyPreserveHost On


 # static html, js, images, etc. served from coolwsd
 # browser is the client part of Collabora Online
 ProxyPass           /browser http://127.0.0.1:9980/browser retry=0
 ProxyPassReverse    /browser http://127.0.0.1:9980/browser


 # WOPI discovery URL
 ProxyPass           /hosting/discovery http://127.0.0.1:9980/hosting/discovery retry=0
 ProxyPassReverse    /hosting/discovery http://127.0.0.1:9980/hosting/discovery


 # Capabilities
 ProxyPass           /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities retry=0
 ProxyPassReverse    /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities


 # Main websocket
 ProxyPassMatch      "/cool/(.*)/ws$"      ws://127.0.0.1:9980/cool/$1/ws nocanon


 # Admin Console websocket
 ProxyPass           /cool/adminws ws://127.0.0.1:9980/cool/adminws


 # Download as, Fullscreen presentation and Image upload operations
 ProxyPass           /cool http://127.0.0.1:9980/cool
 ProxyPassReverse    /cool http://127.0.0.1:9980/cool
 # Compatibility with integrations that use the /lool/convert-to endpoint
 ProxyPass           /lool http://127.0.0.1:9980/cool
 ProxyPassReverse    /lool http://127.0.0.1:9980/cool

However, Plesk is using Apache to serve and Nginx to proxy, so this configuration, while allowing me to try to open proper .docx files, does not succeed in opening those files. After a long wait, the final error I'm getting is:

Document loading failed

Failed to load Nextcloud Office - please try again later
 
Hello, @bosse1 . I believe the configuration should be re-written for Nginx and added in Plesk > Domains > example.com > Apache & Nginx Settings > "Additional Nginx directives". However, I am not 100% sure that alone will solve the problem. There's an older thread on this topic, that might help. I would still suggest consulting directly with Nextcloud as the official vendor of the extension:
 
Hi Sebahat

I'm most grateful for your reply.

I tried the nginx configuration detailed below, but I get the error below as soon as I paste it into the Additional Nginx Directives field.

Invalid nginx configuration: nginx: [emerg] "server" directive is not allowed here in /var/www/vhosts/system/oseimc.co.uk/conf/vhost_nginx.conf:1nginx: configuration file /etc/nginx/nginx.conf test failed

server {
listen 443 ssl;
server_name collabora.mydomain.com;


ssl_certificate /path/to/certificate;
ssl_certificate_key /path/to/key;


# static files
location ^~ /browser {
proxy_pass http://127.0.0.1:9980
proxy_set_header Host $host;
}


# WOPI discovery URL
location ^~ /hosting/discovery {
proxy_pass http://127.0.0.1:9980
proxy_set_header Host $host;
}


# Capabilities
location ^~ /hosting/capabilities {
proxy_pass http://127.0.0.1:9980
proxy_set_header Host $host;
}


# main websocket
location ~ ^/cool/(.*)/ws$ {
proxy_pass http://127.0.0.1:9980
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_read_timeout 36000s;
}


# download, presentation and image upload
location ~ ^/(c|l)ool {
proxy_pass http://127.0.0.1:9980
proxy_set_header Host $host;
}


# Admin Console websocket
location ^~ /cool/adminws {
proxy_pass http://127.0.0.1:9980
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_read_timeout 36000s;
}
}

I have had to resort to the built-in CODE server, which is useless for anything beyond 5 users. I may have to resort to Nextcloud AIO and abandon Plesk to resolve this. Sadly, it means letting go of the useful and labour-saving Nextcloud extension.
 
@bosse1, anything you paste it into the Additional Nginx Directives field gets added to the domain server {} directive already. Which is why if you past another server {} directive you end up with the error your getting. Instead, try adding only the various location {} directives. Based on your previous post that would be just:

NGINX:
# static files
location ^~ /browser {
  proxy_pass http://127.0.0.1:9980
  proxy_set_header Host $host;
}

# WOPI discovery URL
location ^~ /hosting/discovery {
  proxy_pass http://127.0.0.1:9980
  proxy_set_header Host $host;
}

# Capabilities
location ^~ /hosting/capabilities {
  proxy_pass http://127.0.0.1:9980
  proxy_set_header Host $host;
}

# main websocket
location ~ ^/cool/(.*)/ws$ {
  proxy_pass http://127.0.0.1:9980
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection "Upgrade";
  proxy_set_header Host $host;
  proxy_read_timeout 36000s;
}

# download, presentation and image upload
location ~ ^/(c|l)ool {
  proxy_pass http://127.0.0.1:9980
  proxy_set_header Host $host;
}

# Admin Console websocket
location ^~ /cool/adminws {
  proxy_pass http://127.0.0.1:9980
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection "Upgrade";
  proxy_set_header Host $host;
  proxy_read_timeout 36000s;
}
 
@bosse1, anything you paste it into the Additional Nginx Directives field gets added to the domain server {} directive already. Which is why if you past another server {} directive you end up with the error your getting. Instead, try adding only the various location {} directives. Based on your previous post that would be just:

NGINX:
# static files
location ^~ /browser {
  proxy_pass http://127.0.0.1:9980
  proxy_set_header Host $host;
}

# WOPI discovery URL
location ^~ /hosting/discovery {
  proxy_pass http://127.0.0.1:9980
  proxy_set_header Host $host;
}

# Capabilities
location ^~ /hosting/capabilities {
  proxy_pass http://127.0.0.1:9980
  proxy_set_header Host $host;
}

# main websocket
location ~ ^/cool/(.*)/ws$ {
  proxy_pass http://127.0.0.1:9980
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection "Upgrade";
  proxy_set_header Host $host;
  proxy_read_timeout 36000s;
}

# download, presentation and image upload
location ~ ^/(c|l)ool {
  proxy_pass http://127.0.0.1:9980
  proxy_set_header Host $host;
}

# Admin Console websocket
location ^~ /cool/adminws {
  proxy_pass http://127.0.0.1:9980
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection "Upgrade";
  proxy_set_header Host $host;
  proxy_read_timeout 36000s;
}
Hi Kasper

Thanks for the pointer. I will look at this and report back.

Cheers
 
Back
Top