Q
Q
Quad_Tree2018-05-18 17:19:54
Nginx
Quad_Tree, 2018-05-18 17:19:54

How to exclude part of url from location?

I set up a proxy in Nginx for Yandex mail:

location /mail {
proxy_pass https://mail.yandex.ru
}

Now, when visiting example.com/mail, the request goes to https://mail.yandex.ru/mail and returns 404, but should go to https://mail.yandex.ru, that is, exclude "/mail" from the request . How to implement it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2018-05-18
@Quad_Tree

Add a slash at the end of the proxy_pass.
nginx.org/en/docs/http/ngx_http_proxy_module.html#...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question