Yes. I run it in a subpath (https://<hostname>/jsreportapp). My jsreport pdf is composed of a template + script. When I render the template and use log statements, it executes successfully. It's just the templates are not been able to render. If I create a new template with a simple text message, it works often. It's just sometimes it throws 502 bad gateway error too. More details of 502 bad gateway error:
client.js?5980ca6d76eb120c819b:6 Uncaught (in promise) Error: <html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>openresty/1.11.2.1</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
...
at b (client.js?5980ca6d76eb120c819b:6)
at client.js?5980ca6d76eb120c819b:6
at f.callback (client.js?5980ca6d76eb120c819b:55)
at f.<anonymous> (client.js?5980ca6d76eb120c819b:55)
at f.n.emit (client.js?5980ca6d76eb120c819b:9)
at XMLHttpRequest.n.onreadystatechange (client.js?5980ca6d76eb120c819b:55)
Kulwinder Kakar
@Kulwinder Kakar
Posts made by Kulwinder Kakar
-
RE: Jsreport render template and scripts behind enterprise Proxy
-
Jsreport render template and scripts behind enterprise Proxy
I am trying to run jsreport docker container on port 5488 in an environment that uses Nginx for reverse proxy. The Nginx is configured to handle forward proxies as well. When I run JsReport container and render template, I receive 502 gateway Error (Openresty). Since all the containers are running behind enterprise proxy, I suspect I am getting the error due to proxy issue. Also, I see this error (The licensing server was not reachable during instance startup. The instance now runs in the enterprise mode.) in container logs ( so I assume the jsreport container is not able to connect online to fetch license or anything). Can anyone guide me on how to use forward proxy in jsreport?
The following code runs jsreport container:
const jsreport = require('./')({ rootDirectory: __dirname })
if (process.env.JSREPORT_CLI) {
module.exports = jsreport
} else {
jsreport.init().then(() => {
}).catch((e) => {
console.log("Error:",e)
console.trace(e)
process.exit(1)
})
}