Hi I want a rewrite rule, but i don't want to redirect it, and requesting one URL but load different content from another URL. So, I think last and break flag in rewrite directive is a good solution. But, it's always redirected, I search the problem and they state that if the new URL not from nginx instance it will redirect instead. Here several lines of my config:
... rewrite ^(/\w+/$)(.+\.php) /$2 last; proxy_pass upstream_name:80; ...
What i ask is how i can use rewrite but not redirected?
Update: For example, i want to make a new like /link/asd, but there is no /link/asd in my web application. I want my /link/asd link load resource from /asd link. then, i think the rewrite last flag is a good solution. If my understanding is false, please correct me and explain it. Thank you
rewrite
statement is not generating the redirect.