Nginx proxy problem

Hi, I have installed matomo under a URL which is working fine (docker).
I have an other host with a nginx installed and I try to proxy matomo from a subdirectory.
The problem is that once I press login, I don’t get redirected inside the matomo but to the base root.

Should:

client → s1.public.com/matomo (1) → login → s1.public.com/matomo (2)

But I get:

(2) without the matomo (subdirectory) (can’t insert more than two links…)

What am I missing?

config.ini.php:
proxy_client_headers[] = HTTP_X_FORWARDED_FOR
proxy_host_headers[] = HTTP_X_FORWARDED_HOST
proxy_uri_header = 1
nginx.confg:
location /matomo/{
proxy_pass https://192.168.1.1/; #ip of matomo host.
proxy_set_header Host s1.private.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_buffering off;
}

Thank you