NGINX proxying requests rewrite

Is it possible in NGINX to proxy requests to UPSTREAM to request using REWRITE rules? For example I have a query like:
get /one/two/three/four/image.png
It is necessary to sponsirovat on upstrem in the form of GET one?param1=two¶m2=three, etc.
Reading the documentation did not help
October 7th 19 at 22:26
2 answers
October 7th 19 at 22:28
Solution
nginx.org/ru/docs/http/ngx_http_proxy_module.html#proxy_pass

location /name/ {
rewrite /name/([^/]+) /users?name=$1 break;
proxy_pass 127.0.0.1;
}

Isn't it?
Almost... the question is — what URL will go to 127.0.0.1? - Dewayne.Russel73 commented on October 7th 19 at 22:31
Must come after rewrite.
Me here other question torments for more than a year
forum.nginx.org/read.php?21,202760 - amparo_Hickle commented on October 7th 19 at 22:34
Custom:
location /name {
 rewrite ^/name/(.+)$ /nom/?p=$1 break;

 proxy_pass <a href="http://127.0.0.1:81;">http://127.0.0.1:81;</a>
 "proxy_redirect" off;

 proxy_set_header Host $Host;
 proxy_set_header X-Real-IP $remote_addr;
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}


Create:
# cat ./nom/index.php

Contact:
site.com/name/r3443

Received:
Array ( [p] => r3443 ) - jaylan88 commented on October 7th 19 at 22:37
to Nc_Soft
The answer to this question is contained right in the documents for which the above given link.
The server name, its port and the passed URI can also be specified using variables:

proxy_pass http://$host$uri;

or this:

proxy_pass $request;


nginx.org/r/proxy_pass/ru - Ignatius.Fadel34 commented on October 7th 19 at 22:40
October 7th 19 at 22:30
To break the task into two: 1) rewrite 2) the proxy, each of which is solved by a separate rule
This is understandable, but it is not clear how to put together. UPSTREAM understands only URLs in a certain format, and it will not impact. - Dewayne.Russel73 commented on October 7th 19 at 22:33

Find more questions by tags ProxyFrontendNginx