Maybe separate the auth header like https://stackoverflow.com/questions/31752562/how-can-i-use-mod-rewrite-to-proxy-the-userinfo-component-of-a-uri
Since OLS supports rewrite in .htaccess file only, you might want to check the realm guide as well.
Or use LiteSpeed Web Server.