Lovelace login problem

Hi.
Have an irrititing problem with login to home assistant.
The login window appears ok:


But after entering user and password, I get the following:

I then have to click the left arrow and restart login:
image
It always works on the second attempt, but there is then a notification of a failed login:
image

image

The logfile shows the following:

Homeassistant is running on a raspberry pi 4, in a docker container, with access via an nginx container working as a reverse proxy. I suspect it is something to do with the reverse proxy but could not find a similar problem in a search of the forum.
I have another container running another web-based application behind the same reverse proxy, and it works fine.
Any help greatly appreciated.