Setting headers for specific extensions seems impossible

The solution I used was rewrite + proxy on localhost. Might be a solution for you too: