basic rewrite question

halfpastjohn nginx-forum at forum.nginx.org
Wed Oct 18 15:58:38 UTC 2017


Also - our standardization is not the greatest, so I actually want to
rewrite the entire URI, which is why I have ^/(.*) as the regex. However I
don't think the $1 in the replacement string will still apply to the
original URI. Would this work?

location ~* /v1/device/(.*)/ { 
rewrite $uri /api/v1.0/download/$1 break; 
proxy_pass http://api.domain.com; 
}

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,276946,276948#msg-276948



More information about the nginx mailing list