HTML should reference our proxy servername instead of localHost



  • Hi all ... we have a production server that needs to render HTML and have the referring scripts properly pointing to our servername. Our proxy works fine (https://client.ourapp.net/reports), but when we render an html report that has links in it, the following is included in the output file. How do we change this to reference our proxy address above?

    0_1702329709959_upload-9746ab26-6302-4376-bbb6-a272cebd6245



  • It seems you are using html-with-browser-client recipe so you likely intend to render some other reports from the html output.

    This recipe links to the html output script link to the jsreport browser client hosted on the jsreport server. The link is assembled from the request's host you use when rendering the original template. When you call POST to the http://localhost:5488/api/report the html page will try to link the script from the localhost. If you call POST to http://mydomainwithjsreport.net/api/report, the link will get jsreport browser client from the mydomainwithjsreport.

    In other words, your rendering request needs to target https://client.ourapp.net/reports/api/report and you need to additionally configure jsreport so it knows it is hosted on subpath.
    https://jsreport.net/learn/configuration#web-server

    "appPath": "/reports"
    


  • @admin ... yes, we are linking to scripts and subreports.

    My scenario is directly related to this playground example, and I'm uncertain where I explicitly call the POST - https://playground.jsreport.net/w/dqueubed/evJHTFm3

    Can you pinpoint that for me please?

    Thanks again for all your help. It's greatly appreciated.



  • Also, this is how our config file begins ...
    0_1702395600367_upload-7c5368ef-346f-4c1b-be0b-d347c117d4ea

    That looks correct, right?



  • ACTUALLY ... hold on a moment. Just found where I call the url in my node.js script.

    No need to respond again ... yet.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.