<div dir="ltr"><div><div><div><div><div><div><div><div><div>Hello guys,<br><br></div>I'm trying to find a way to use OpenStack SWIFT with nginx, the below are request steps:<br><br></div>1. nginx is configured as proxy cache<br>
</div>2. client send a request to nginx for url: <a href="http://domain.com/filename.txt">http://domain.com/filename.txt</a><br></div>3. nginx received the request and it is a cache miss, it need to fetch the content from SWIFT proxy server<br>
</div>4. nginx send a request to swift proxy server for authentication, the url looks like <a href="http://swift-proxy/auth-account">http://swift-proxy/auth-account</a>, account information is set inĀ  header, the response from swift proxy server contains a auth-token for that account if authentication success.<br>
</div>5. then nginx use this auth-token and put it in a new request header, and send the new request to the swift proxy server for the original request content, there could be a map between client request url to the swift proxy url, for example, /filename.txt --> /account/container/filename.txt, so the new requst url could be <a href="http://swift-proxy/account/container/filename.txt">http://swift-proxy/account/container/filename.txt</a>, plus the auth-token.<br>
</div>6. swift proxy sever response the content to nginx, then nginx cache the content and pass the response to the client.<br><br></div>Could the above requirement be accomplished by some specific configuration plus some existing nginx modules?<br>
<br><br></div>Thanks,<br>Andy<br><div><div><br><br></div></div></div>