Successful login redirects to wrong location

I have configured nginx to access the Matomo docker container as subdirectory

Everything works fine but there is one annoying issue: When I log in Matomo redirects me automatically to

but it should be:

How can I configure the redirect that happens after successful login?