RewriteRule in .htaccess not working with Cloudflare APO

Hi,
I need to display content of https://my.example.com for the page https://example.com/app.
https://example.com is a wordpress for which I added the following lines in the .htaccess file:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Check if the request is for /app
RewriteCond %{REQUEST_URI} ^/app
# Proxy the request to https://my.example.com/
RewriteRule ^app(.*)$ https://my.example.com$1 [P,L]
</IfModule>

When I am logged as an admin in the wordpress, everything works fine.
But for any other use case, https://example.com/app is not found.
I strongly suspect that it comes from Cloudflare as I am using Cloudflare APO.

Any idea about how to solve this issue?

Thanks.
Christian