J
J
Jerryzzz2021-03-01 17:38:37
Nginx
Jerryzzz, 2021-03-01 17:38:37

Proxying and modifying requests in nginx, How to do it right?

Suppose you need to modify the request when accessing the nginx proxy server.
That is, the nginx server, having received such a request 123.123.123.123:18085/?url=222.222.222.222%3A8085 , should redirect the request to the server 222.222.222.222:8085

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2021-03-01
@ky0

Suppose nginx does not receive a request in the form that you described - it receives a GET /?url=222.222.222.222%3A8085. If you want to get an argument and use it as part of a new url, there are built-in variables for this + the rewrite module .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question