I've got what I think is a common use case,
I'm following the directions for using NginX as a proxy here:
https://cwiki.apache.org/confluence/display/COUCHDB/Nginx+as+a+proxy
They are almost good enough.
They explain how to make a proxy using a subdirectory
and they also explain how to give special treatment for the _changes url to
ensure that continuous replication works OK.
But they don't explain how to do both of those simultaneously.
Perhaps they thought it was obvious? So did I, but what I did doesn't work.
I've got regular REST calls to the non-_changes API working over SSL
but continuous replication fails ( with out an error )
and when I curl:
$ curl http://user:[email protected]/couchdb/my_db/_changes
Gives an nginx html error:
<h1>Not Found</h1><p>The requested URL /couchdb/my_db/_changes was not
found on this server.</p>
So the URL handling in my .conf file isn't right.
Here's what I have under the server block of my sites-enabled .conf file :



location /couchdb {

            rewrite /couchdb(.*) /$1 break;

            proxy_pass http://localhost:5984;

            proxy_redirect 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 ~ ^/couchdb/(.*)/_changes {

            rewrite /couchdb(.*) /$1 break;

            proxy_pass http://localhost:5984;

            proxy_redirect off;

            proxy_buffering off;

            proxy_set_header Host $host;

            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

  }

If some one spots what I'm doing wrong please let me know

Best,

Doug

Reply via email to