Cant connect Microsoft Office web server to nextcloud office online

Hi, I have a problem with adding Microsoft web office online to Nextcloud. The screenshots show that WACSM is working. I also added nextcloud address in officewebapphost. My setup is as follows, I have a server running Ubuntu 22.04 with nextcloud installed and a virtual server running qemu Windows server 2012 r2 with office web app server installed. After adding to online office domain wacsm and its port Office Online server is reachable, but as soon as I refresh the page there is an error Could not establish connection to the Office Online server. When I try to open the file, the error is shown on the screenshot. In nextcloud logs there are a lot of errors of the similar type
simplexml_load_string(): vVnB2ST0=" defer src="/apps/files_rightclick/js/script.js?v=1835b358-0"></script at /var/www/html/custom_apps/officeonline/lib/WOPI/Parser.php#168