just another apache to nginx rewrite question
        Posted  
        
            by 
                Brandon
            
        on Server Fault
        
        See other posts from Server Fault
        
            or by Brandon
        
        
        
        Published on 2011-06-21T07:15:19Z
        Indexed on 
            2011/06/21
            8:24 UTC
        
        
        Read the original article
        Hit count: 271
        
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.
© Server Fault or respective owner