When I deploy a JSS app to a Sitecore instance running in a Docker Container and run our applications in Integrated Mode, our application is accessible with a hostname and port number (e.g. http://jss.sc9.local:44001/
). However, the page that Sitecore renders contains image links that are missing the port number and result in HTTP 404 errors (e.g. the link Sitecore renders in the page is
http://jss.sc9.local/-/jssmedia/jss-helix-react-ts-starter/data/media/img/sc_logo.ashx?h=51&iar=0&w=204&hash=D53403E7F32EFFCEAB6C3FBC8E88E034
instead of
http://jss.sc9.local:44001/-/jssmedia/jss-helix-react-ts-starter/data/media/img/sc_logo.ashx?h=51&iar=0&w=204&hash=D53403E7F32EFFCEAB6C3FBC8E88E034
).
How do we get Sitecore to render the pages with the port number in the image URLs? Is it related to this problem?
This happens with our own application as well as with this starter application. Both are React applications. I tried adding the port number to the hostname
attribute of the site
element of the sitecore/config/*.config
as shown below, but that breaks Sitecore's URL application resolution (e.g. going to http://jss.sc9.local:44001 gives you the generic Sitecore page instead of our application).
Thanks in advance!