Couchdb and Nginx Proxies

3 views
Skip to first unread message

Paul Milner

unread,
Jun 10, 2023, 8:31:12 AM6/10/23
to us...@couchdb.apache.org
Hello there,

further to my issues with couchdb and nginx. I get the following error in
my nginx error log:

2023/06/10 11:55:36 [error] 87270#87270: *115 connect() failed (111:
Connection refused) while connecting to upstream, client: xxx.xxx.xxx.xxx,
server: _, request: "GET /a?limit=1 HTTP/1.1", upstream:
"http://[::1]:5984/a?limit=1",
host: "12.12.12.12"

The request actually always succeeds but I always get this message.

My bind in local.ini and default.ini is:

port = 5984
bind_address = 127.0.0.1;0.0.0.0;::

Would anyone know why please?

Thanks
Paul

ermouth

unread,
Jun 10, 2023, 8:32:33 PM6/10/23
to us...@couchdb.apache.org
> http://[::1]:5984/a?limit=1

You likely have 127.0.0.1 denoted as localhost in nginx config. Make it
127.0.0.1 back, it will disable IPv6 connection upstream.

ermouth

Andrew Ellerton

unread,
Jun 10, 2023, 10:16:16 PM6/10/23
to us...@couchdb.apache.org
If couch itself is working fine (eg test via curl on the server) then this
sounds a lot purely nginx config, not couch.

With that said if you post more of your config and more info I can try to
help.

Paul Milner

unread,
Jun 11, 2023, 11:06:12 AM6/11/23
to us...@couchdb.apache.org
Thanks both for the info

I played around with the bind address and found that it had different
effects. I couldn't get it to work with multiple ips (i tried with , and ;
and got various errors depending on spacing), so settled for ::1 which then
gave me an upstream error against 127.0.0.1, so i added a listen on
127.0.0.1 that pointed to localhost in nginx and it has now stopped the
errors. I don't know how efficient that is but it seems to work.

curl works against 127.0.0.1:5984, localhost:5984 and [::1]:5984 so i think
i'm well covered.

Thanks again
Paul

On Sun, 11 Jun 2023 at 04:16, Andrew Ellerton <andrew.j...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages