just another apache to nginx rewrite question
- by Brandon
I have the following Apache rewrite directives:
RewriteCond %{REQUEST_URI} ^/proxy(/|$) [NC]
RewriteCond %{QUERY_STRING} (^|&)uri=(.*?)(&|$) [NC]
RewriteRule .* /api/vs1.0/%2 [NC,L]
And I'm trying out nginx, so trying to move the rewrites over. I came up with...
rewrite ^/proxy(/|$) /api/vs1.0/$2 last;
rewrite (^|&)uri=(.*?)(&|$) /api/vs1.0/$2 last;
Which is probably grossly incorrect. I'm just a mere web developer, so I was wondering if anyone could lend a hand here. I would be much obliged. I see that I am ignoring the query string specification, but I'm thinking that it shouldn't matter. I only have a vague idea of what the original rewrite is accomplishing, so I haven't much hope here in coming up with something decent, despite reading the relevant documentation for both servers.