I have a couchbase server behind a NGINX reverse proxy (behind the subpath /db).
How do I specify the correct connection string in Python?
I tried
from couchbase.cluster import Cluster, ClusterOptions
from couchbase.auth import PasswordAuthenticator
cluster = Cluster('couchbase://testserver.com/db', ClusterOptions(
PasswordAuthenticator('Administrator', 'password')))
But I get
ValueError: Cannot pass bucket to connection string: db
Accessing the admin website at https://testserver.com/db/_utils/index.html works.
NGINX configuration:
server {
listen 80;
server_name testserver.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name stagingpos.rsj.de;
ssl_certificate /etc/ssl/xxx.crt;
ssl_certificate_key /etc/ssl/xxx.key;
location / {
proxy_pass http://127.0.0.1:8001;
proxy_set_header X-Forwarded-For $remote_addr;
}
location /db {
rewrite /db/(.*) /$1 break;
proxy_pass http://127.0.0.1:5984/;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Ssl on;
}
location /_session {
proxy_pass http://127.0.0.1:5984/_session;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X_Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded_Ssl on;
}
}