Answer the question
In order to leave comments, you need to log in
How to configure proxy_pass on nginx?
При таком nginx конфиге
location /fake {
proxy_pass http://fake:3050;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Такой запрос /fake/product/Pirozhnoe_kartoshka проксируется на http://fake:3050 по такому же урлу http://fake:3050/fake/product/Pirozhnoe_kartoshka , а нужно на http://fake:3050/product/Pirozhnoe_kartoshka
Как этого можно достичь?
Answer the question
In order to leave comments, you need to log in
The problem was solved in this way:
location /fake {
proxy_pass http://fake:3050;
rewrite /fake(.*)$ $1 break;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question