Since you are not authenticated the <script> tags loading resources from behind the proxy will fail.
The <script> tag can't redirect the entire page hence the script entry point fails to load.
A quick and dirty fix to the problem is to upload a page as a extension similar to this: enigma.js/redirect.html at master · qlik-oss/enigma.js · GitHub
So instead of accessing your page a user would navigate to the redirect dummy page behind the proxy, authentication kicks in and you are re-directed to your authentication module. After authentication you are re-directed to the dummy page which in turn re-directs you back to whatever external page you define.