Swift and Nginx as loadbalancer
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I'm experiencing Content-Length parameter issue when using nginx as a loadbalancer for Swift.
I've configured Swift with two proxies and nginx as loadbalancer.
nginx config :
upstream backend_storage {
server swift-proxy1:8888 weight=3;
server swift-proxy2:8888;
}
server {
client_
listen 8888;
location / {
proxy_pass http://
proxy_
}
}
proxy-server.conf
[filter:tempauth]
use = egg:swift#tempauth
user_system_root = testpass .admin http://
Then I tried use Swift CLI client and got:
# swift -A http://
Container PUT failed: http://
Nginx requires:
when someone do a PUT request, there should be Content-Length field in http header.
Then I've added in put_container function for swift CLI client
headers[
Now everything works fine.
Could you comment this error?
P.S. Actually HTTP protocol RFC does not requires Content-Length parameter in PUT request.
It looks like nginx is picky with PUT/POST requests without Content-Length header.
Reference: http:// www.ruby- forum.com/ topic/162976# 715758
Using 0 as Content-Length doesn't look right, and you may have the same problem with any other client not setting Content-Length properly.
I gave up using nginx as swift load balancer. I'd recommend you using Pound instead: http:// www.apsis. ch/pound