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

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

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

 proxy_pass <a href=";">;</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;

# cat ./nom/index.php


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; - 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