Broken CID images when connecting to DXA Web application as localhost

When using Contextual Image Delivery (CID) on SDL Web 8, the stand-alone CID Service connects back to the Web application to retrieve the original image. To allow that, the Web application includes its own address in the request sent to the CID service. SDL Digital Experience Accelerator (DXA) uses the address of the incoming request. However, if the incoming request is a localhost URL and the CID Service is not running on the same host as the DXA Web application, the image may not be retrieved.

To avoid this issue, specify the address or hostname to use, instead of localhost. You can do that in the following locations:
  • For NET: in the Web.config file, set the cid-localhost property.
  • For Java: in the dxa.properties file, set the dxa.modules.cid.appHostMapping property.