Answer the question
In order to leave comments, you need to log in
How to send a POST request to static files in Nginx?
Task.
Proxy a request based on the value of a POST variable using Nginx.
The load on the server is minimal, so I want to get by with one Nginx.
Description
A request with data in POST url=x1.server.ru arrives at the server.ru server, you need to proxy it to x1.server.ru. If the post has url=x2.server.ru, then we proxy it to x2.server.ru.
Non-working solution
location /
{
if ($request_body ~* "x1.server.ru") {
proxy_pass http://x1.server.ru;
break;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question