Client login fails with 401

I have this in the vhost:

ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9000/var/www/$1 

Edit: I see that the manual calls for uncommenting the lines in the php-fpm config file (www.conf in my case) that set the environment variables. I hadn’t done that, but doing so (and restarting php-fpm) doesn’t seem to help things.

Edit 2: This post on the owncloud forums sure sounds like it’s describing the same behavior.

Edit 3: This bug suggests that adding this:

RewriteEngine On
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]

to your virtual host configuration will fix the issue. And, indeed, I can log in using the desktop client if I add it. But lots of files aren’t syncing, and I’m having trouble figuring out why. It’s looking like progress though…