Redirect loop behind proxy

I have setup new self-installed seafile instace on MariaDB behind apache2 proxy

Because of only single public IP address I have to have this server behind another apache2 proxy that handles SSL redirects to server with seafile to

https -> ssl proxy server -> http seafile server

After many experiments I was not able to setup it correctly, it ends up in Redirect loop between ‘’ and ‘

loop can be seen here:

first apache ssl proxy config

apache seafile proxy config
I was able to configure it accessing ip address of seafile server on port 8000. Seahub config: