<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">take a look at this example, sdb should not be that different<div><br></div><div><a href="https://github.com/lovelysystems/nginx-examples/tree/master/s3">https://github.com/lovelysystems/nginx-examples/tree/master/s3</a></div><div><br></div><div>cheers, bernd</div><div><br><div><div>On Apr 28, 2011, at 12:28 AM, AndrewH wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>I am looking for some advice on the recommended way of achieving the<br>following.<br><br>I need to sign Amazon Simple Database (SDB) queries with our Amazon Web<br>Services credentials before forwarding them to upstream Amazon's SDB<br>servers. &nbsp;<br><br>The proxying behaviour will be taken care of by the proxy module but I'm<br>not sure how to implement the actual signing.<br><br>On first glance, it sounds similar to the module that performs this for<br>Amazon S3 requests. &nbsp;Unfortunately this doesn't work for SDB requests as<br>the parameters in an SDB request are encoded in the arguments of the URI<br>(...site.com/?SDBArg1=val1&amp;SDBArg2=val2) &nbsp;whereas S3 parameters are<br>passed as separate HTTP headers. &nbsp;<br><br>I have looked at the rewrite module but the URI can only be manipulated<br>using regular expressions and the processing I need to do is more<br>complex than what the rewrite module can achieve ie.<br><br>1 Parse and decode the URI args to an SDB args list<br>2 Add several args to the SDB args list<br>3 Sort SDB args list<br>4 Generate a SHA message digest of the SDB args list using a user<br>supplied variable as a key - the Base64 encoding of this is the<br>signature.<br>5 Append the signature to the SDB args list<br>6 Regenerate the URI args<br>7 Forward it to the upstream<br><br>I believe I might be able to do using imbedded Python and writing the<br>logic as script and integrating it via the rewrite module - but I don't<br>know Python (I'm a C/C++ dev) and I'm also not in a position to know<br>whether this solution would scale satisfactorily - so this is not my<br>preferred option.<br><br>What I need to know is what approach I should take to solving this with<br>minimal effort ie. is there a way of creating a filter that layers<br>before or after the proxy module which does this work.<br><br>Posted at Nginx Forum: <a href="http://forum.nginx.org/read.php?2,194135,194135#msg-194135">http://forum.nginx.org/read.php?2,194135,194135#msg-194135</a><br><br><br>_______________________________________________<br>nginx mailing list<br><a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>http://nginx.org/mailman/listinfo/nginx<br></div></blockquote></div><br></div></body></html>