Couchbase Admin login page through reverse proxy

79 views
Skip to first unread message

Suresh Joshi

unread,
May 7, 2015, 10:40:31 PM5/7/15
to couc...@googlegroups.com
I've seen this topic mentioned once or twice, but never saw it resolved. I'm trying to put Couchbase and Sync Gateway behind Nginx. 

With the below config, sync gateway works correctly, and Couchbase -seems- to work, except I get a 404 on login, and can never login. If I set Couchbase to be my root URL, it works fine. By the way, the headers I originally set for the DB location started off few and far between, but reading over the internet, I just started adding!

Thanks!
-SJ

upstream couchbase_admin {
    server localhost:8091;
}

upstream couchbase_api {
    server localhost:8092;
}

upstream sync_gateway {
    server localhost:4984;
}

server {
    listen 80;
    server_name  example.net;
    client_max_body_size 20m;

    location /db/ {
        proxy_pass              http://couchbase_admin/;

        proxy_set_header  Authorization $http_authorization;
        proxy_pass_header Authorization;
        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header  X-Forwarded-Proto $scheme;
        proxy_set_header  Host $http_host;
        proxy_set_header        X-Real-IP $remote_addr;
    }


    location /api/ {
        proxy_pass              http://couchbase_api/;
    }

    location /sync/ {
        proxy_pass              http://sync_gateway/;
        proxy_pass_header       Accept;
        proxy_pass_header       Server;
        proxy_http_version      1.1;
        keepalive_requests      1000;
        keepalive_timeout       360s;
        proxy_read_timeout      360s;
    }
}

Suresh Joshi

unread,
May 21, 2015, 7:14:24 PM5/21/15
to couc...@googlegroups.com
As an update to this, I basically can't find any way to get Couchbase to work behind Nginx unless I specifically use port 8091. 
Reply all
Reply to author
Forward
0 new messages