如何在Apache反向代理之后使用CouchDB?

我刚刚从我的Debian上用apache 2.4.10安装了CouchDB。

$ curl http://localhost:5984/ {"couchdb":"Welcome","uuid":"76929f1fc6f1e2c01edcd5b712fff044","version":"1.6.1","vendor":{"version":"1.6.1","name":"The Apache Software Fou ndation"}} 

我想通过https Apache反向代理使用它:

 <IfModule mod_ssl.c> <VirtualHost _default_:443> ServerAdmin webmaster@localhost DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride All SSLRequireSSL </Directory> #For using my owncloud and wiki without HTTP AUTH, and all the rest #with HTTP AUTH <LocationMatch "^/(?!owncloud|wiki)"> AuthType Basic AuthName "Acces Restreint" AuthBasicProvider file AuthUserFile /home/...myfile Require valid-user AllowOverride All </LocationMatch> ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined #Here I try to configure my reverse proxy for accessing CouchDB through https://example.com/couchdb/ <Location /couchdb> ProxyPass http://localhost:5984/ ttl=60 ProxyPassReverse http://localhost:5984/ ProxyPassReverseCookieDomain localhost example.com RequestHeader set Origin "http://localhost:5984" AllowOverride all AuthType Basic AuthName "Acces Restreint" AuthUserFile /home/...myfile Require valid-user </Location> SSLProxyEngine On SSLEngine on SSLCertificateFile /..../file.pem <FilesMatch "\.(cgi|shtml|phtml|php)$"> SSLOptions +StdEnvVars </FilesMatch> <Directory /usr/lib/cgi-bin> SSLOptions +StdEnvVars </Directory> BrowserMatch "MSIE [2-6]" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 # MSIE 7 and newer should be able to use keepalive BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown </VirtualHost> </IfModule> 

但是当我尝试通过互联网连接到: https : //example.com/couchdb

我得到以下结果:

 {"error":"unauthorized","reason":"Name or password is incorrect."} 

所以似乎couchdb正在响应,但为什么它需要一个授权,而没有使用:

 $curl http://localhost:5984/ 

任何线索?

find了 ! 我不得不取消授权标题:

我还必须更改http:// localhost:5984 / http:// localhost:5984

  <Location /couchdb> ProxyPass http://localhost:5984 ttl=60 ProxyPassReverse http://localhost:5984 ProxyPassReverseCookieDomain localhost example.com RequestHeader set Origin "http://localhost:5984" RequestHeader unset Authorization AllowOverride all AuthType Basic AuthName "Acces Restreint" AuthUserFile /... Require valid-user </Location>