Proxy passing Gitlab external url

I have Gitlab-ce setup in local server with a local ip

Whenever I try to proxy pass that URL to my domian, gitlab forwards the URL and redirects to a different one.

Eg.
i have set my gitlab external url at http://172.xx.xxx.xx/mygitlab

When I try to proxy pass that URL to my domain https://www.example.com/example/mygitlab/, it redirects to https://www.example.com/example/users/signin when it should be redirecting it to https://www.example.com/example/mygitlab/users/signin.

I want to keep https://www.example.com/example/ constant.

I tried finding it in gitlab.rb file but no luck.

Also I have many working URLs in my proxy pass and they’re working.

Thanks