How to exclude some url from the location?

I set up a proxy in Nginx for mail Yandex:
location /mail {
proxy_pass https://mail.yandex.ru
}

Now when coming to example.com/mail the request is sent to https://mail.yandex.ru/mail and gives a 404, and should refer to https://mail.yandex.ru, that is, exclude the "/mail" from the query. How to implement it?
June 5th 19 at 21:09
1 answer
June 5th 19 at 21:11
Solution

Find more questions by tags Nginx