Failed to load Nextcloud Office - please try again later

When I try to open a document in Nextcloud I get the this error: “Failed to load Nextcloud Office - please try again later”.

I have Collaboraonline running on a VPS with a Nginx reverse proxy and my Nextcloud hosted at Hetzner: Nextcloud Hub 8 29.0.9

Summary of the issue you are facing:

When I try to open a document in Nextcloud I get the this error: “Failed to load Nextcloud Office - please try again later”.

Steps to replicate it:

When log in NextCloud with Google Chrome and try to open a document I get the message: “Failed to load Nextcloud Office - please try again later” and in Chrome I see:

chromewebdata/:1 Refused to display 'https://DOMAIN.COM/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

If I open Nexcloud in Firefox or Incognito tab in Chrome and do the same, I can open the documents, with out the error?

Allow list for WOPI requests contains the IP adresse of the VPS + I have added 0.0.0.0/0

My reverse nginx proxy setting:

server {
  #listen 443 quic;
  listen 443 ssl;
  http2 on;
  #http3 off;
  {{ssl_certificate_key}}
  {{ssl_certificate}}
  server_name doc.vels.it;
  #{{root}}

  {{nginx_access_log}}
  {{nginx_error_log}}

  if ($scheme != "https") {
    rewrite ^ https://$host$request_uri permanent;
  }

  location ~ /.well-known {
    auth_basic off;
    allow all;
  }

  {{settings}}

  include /etc/nginx/global_settings;

  index index.html;

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

 }


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

 }


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

 }


 # main websocket
 location ~ ^/cool/(.*)/ws$ {
   proxy_pass https://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 https://127.0.0.1:9980;
   proxy_set_header Host $host;

 }


 # Admin Console websocket
 location ^~ /cool/adminws {
   proxy_pass https://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;

 }

  if (-f $request_filename) {
    break;
  }
}

In nginx I did disable

add_header X-Frame-Options SAMEORIGIN;

And now it works.