Setting up Couchbase Server behind reverse proxy

758 views
Skip to first unread message

atedja.nm

unread,
Nov 26, 2014, 1:43:36 AM11/26/14
to couc...@googlegroups.com
Hi,

I have a Couchbase instance sitting in a private network, and I set up an nginx reverse proxy to talk to the Couchbase Web Console, such that if I type in:

https://xyz.com/couchbase

It will load up the Couchbase web console.  The reverse proxy works, but what's interesting is that the first time I accessed Couchbase, it immediately asked for Username and password, even though I haven't set one up yet.  Normally Couchbase should take you to the configuration page.  I am not sure if I did something wrong with the reverse proxy, or if Couchbase web console is using Javascript in some way that the reverse proxy messes it up.

This is my nginx config

upstream couchbase {
        server  1.2.3.4:8091;
}


server {
        listen 443 ssl;
        server_name xyz.com;

        ssl on;
        ssl_certificate /etc/ssl/certs/ssl_certificate.pem;
        ssl_certificate_key /etc/ssl/private/ssl_certificate.key;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

        ssl_session_timeout 5m;

        location /couchbase/ {
                expires                 off;

                proxy_pass              http://couchbase/;
                proxy_redirect          default;

                proxy_set_header        X-Real-IP $remote_addr;
                proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        }
}


I am totally stumped of what's happening here.

atedja.nm

unread,
Nov 26, 2014, 1:46:37 AM11/26/14
to couc...@googlegroups.com
Ok, I just replaced location /couchbase/ with location /, and it works. But I don't want to use /

Sergey Avseyev

unread,
Nov 26, 2014, 7:19:07 AM11/26/14
to Couchbase Google Group
On Wed, Nov 26, 2014 at 9:43 AM, atedja.nm <ated...@gmail.com> wrote:
>
> location /couchbase/ {
> expires off;
>
> proxy_pass http://couchbase/;
> proxy_redirect default;
>
> proxy_set_header X-Real-IP $remote_addr;
> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
> }


Try to proxy authentication headers too like this

proxy_set_header Authorization $http_authorization;
proxy_pass_header Authorization;


--
Sergey Avseyev
Reply all
Reply to author
Forward
0 new messages