diff --git a/src/app/contentManagement/controllers/OnlyOfficeController.php b/src/app/contentManagement/controllers/OnlyOfficeController.php
index 2a4b4c73f802707002ba70e6e36873c195205d79..ea2fe0a0bfa94663b2fa5a3240e684bb577c09f7 100644
--- a/src/app/contentManagement/controllers/OnlyOfficeController.php
+++ b/src/app/contentManagement/controllers/OnlyOfficeController.php
@@ -178,7 +178,7 @@ class OnlyOfficeController
         $uri = (string)$loadedXml->onlyoffice->server_uri;
         $port = (string)$loadedXml->onlyoffice->server_port;
 
-        if (strpos($checkUrl, "{$uri}:{$port}/cache/files/") !== 0 && ($port != 80 || strpos($checkUrl, "{$uri}/cache/files/") !== 0)) {
+        if (strpos($checkUrl, "{$uri}:{$port}/cache/files/") !== 0 && (($port != 80 && $port != 443) || strpos($checkUrl, "{$uri}/cache/files/") !== 0)) {
             return $response->withStatus(400)->withJson(['errors' => 'Query params url is not allowed']);
         }