nginx add request_url to proxy_path

I have to setup nginx reverse proxy for access to my ec2 servers. Now nginx add request_url(own url) to proxy_path url. How to setup nginx correctly so that it replaces its own address with the address from proxy_path? the proxy is trying to go to “http://ec2-52-59-167-252.eu-central-1.compute.amazonaws.com/ec2-18-197-101-139.eu-central-1.compute. amazonaws.com/api/todo ” my rev.conf upstream nginx_backends { server ec2-52-59-167-252.eu-central-1.compute.amazonaws.com:80;…