Hi Jonathan,
Still working on this issue and I'm at a dead end ... We resolved the issue (partially) above by doing urlrewrite to omit the <comma> <space> <loadbalncer url and now my sharing rest login works. However I feel that this has only resolved the login issue and the redirects using the headers are causing all raster analytics gp tasks to fail (sample error code at the end). I managed to change the redirect-uri by adding ProxyAddHeaders Off and RequestHeader unset X-Forwarded-Host, RequestHeader unset X-Forwarded-For, RequestHeader unset X-Forwarded-Server - to the loadbalancer config, this resulted in the redirect_uri changing to only he internal loadbalancer address - which is of no use. Was not able to make any difference by changing the public facing reverse proxy configs .. so we opted for the Rewrite. So now when I run a rasteranalytics task I get and error that indicates that the response json is incorrect or empty ? I'm assuming because its not getting a response possibly? ** the internal address of teh analytics server is being returned in the error .. Any ideas please . Is there a way to capture the traffic to diagnose this ? .. I had planned to add some python outpt messages in teh offending .py files listed below to see a bit more of whatt was beeing sent around... but was reluctant until I asked the question.

Job Status: esriJobFailed
Job Messages:
esriJobMessageTypeInformative: Submitted.
esriJobMessageTypeInformative: Executing...
esriJobMessageTypeInformative: Start Time: Tuesday, October 19, 2021 4:06:17 PM
esriJobMessageTypeInformative: Raster Analytics helper service: https://<MY RASTER ANALYTICS SERVER>:6443/arcgis
esriJobMessageTypeInformative: Failed script BuildOverview...
esriJobMessageTypeError: Traceback (most recent call last): File "E:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\Resources\ArcToolBox\Services\Scripts\BuildOverview.py", line 15, in <module> import rasterutils File "E:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\Resources\ArcToolBox\Services\Scripts\rasterutils.py", line 153, in <module> RUN_ON_AGOL = isAGOL() File "E:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\Resources\ArcToolBox\Services\Scripts\rasterutils.py", line 143, in isAGOL msgjson = r.json() File "E:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3\Lib\site-packages\requests\models.py", line 898, in json return complexjson.loads(self.text, **kwargs) File "E:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3\Lib\json\__init__.py", line 354, in loads return _default_decoder.decode(s) File "E:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3\Lib\json\decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "E:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs\arcgispro-py3\Lib\json\decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
esriJobMessageTypeError: Failed to execute (BuildOverview).
esriJobMessageTypeInformative: Failed at Tuesday, October 19, 2021 4:06:18 PM (Elapsed Time: 1.19 seconds)
esriJobMessageTypeError: Failed.