S
S
Sergey2019-10-07 14:36:26
Nginx
Sergey, 2019-10-07 14:36:26

Is it possible to configure nginx to go to 307 response in config?

I apologize in advance for a possibly dumb question. I just never worked with the front part, but here it is.
At work, it was necessary to configure the reaction of hosts to a 307 response that came from some server.
The server has 2 duplicate addresses in terms of functionality. Rolled out a request for balancing requests, etc. Among the requirements there is such a point - if our host made a POST request to address 1, it can respond with 307 code and in the http header, in the "Location" tag, the value, conditionally, is "address 2". Then the host should send the same request, but only to address 2.
They suggested that I think about the implementation using nginx. As a result, we managed to set up balancing of outgoing requests, but I could not find a response to a 307 response anywhere on the Internet.
Did I understand correctly that nginx should not solve such problems at all? He does redirects just for requests, but does not work with answers?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
grinat, 2019-10-07
@grinat

Balancing is not done this way, you just write upstream and their weights in the config, https://nginx.org/en/docs/http/ngx_http_upstream_m...
As for the rest, you can do it through lua, or find a module that solves this problem, but this is not the responsibility of the web server

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question