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.


client -> (1) -> login -> (2)

But I get:

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

What am I missing?

proxy_client_headers[] = HTTP_X_FORWARDED_FOR
proxy_host_headers[] = HTTP_X_FORWARDED_HOST
proxy_uri_header = 1
location /matomo/{
proxy_pass; #ip of matomo host.
proxy_set_header Host;
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