Cant use htpasswd + htaccess with nextcloud + (onlyoffice + docker)

Hi, after i had a lot of attacks on my “homeserver with dyndns” i start using .htaccess + .htpasswd file in front of all access to my apache2

now i wont to use the new version of nextcloud in combination with onlyoffice (docker)

i now try about 3 full days and cannot find a solution for my problem.

sometimes it works with .htaccess, sometimes not.

my onlyoffice is on docker port 4433 (SSL) on the same server (Debian 9)
my nextcloud is on the same server on Port 443 (SSL)

if i use it without .htaccess file everything works fine
i can create/edit/delete office files with onlyoffice

but bad people try to hack into my web applications…

my .htaccess file

RewriteEngine on
AuthName “Authentifizieren”
AuthType Basic
AuthUserFile /var/www/html/user/.htpasswd
Require valid-user
satisfy any
deny from all
Allow from 172.17.0.
// 172.17.0.x is dockers ip //
Allow from
Allow from 192.168.24.
// 192.168.24.x is lokal ip range //

i can login with username + password
but i cannot open office dokuments

error = the document can not be saved

i can reach the documentserver and he running in webbrowser

hope somebody can help me

I think it works now.