-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx-base.conf.in
56 lines (50 loc) · 1.3 KB
/
nginx-base.conf.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
listen 80;
listen 5984;
location ^~ /_delete {
internal;
limit_except DELETE {
deny all;
}
include uwsgi_params;
uwsgi_param X_DELETE_DOCUMENT yes;
uwsgi_pass_request_body off;
uwsgi_pass unix:/tmp/wsgi.sock;
}
location ^~ /_attachments {
auth_request /auth;
@ATTACHMENTS_HEADER@
include uwsgi_params;
uwsgi_pass_request_body off;
uwsgi_pass unix:/tmp/wsgi.sock;
}
location / {
if ($request_method = DELETE) {
rewrite ^/(.*) /_delete/$1 last;
}
proxy_pass http://@DB_NAME@:5984@REDIRECT_URI@$request_uri;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
location ~ ^/(.*)_couchdb/nedm/(.*)$ {
proxy_pass http://@DB_NAME@:5984/nedm%2F$2$is_args$args;
}
location ~ ^/(.*)_couchdb/(.*)$ {
proxy_pass http://@DB_NAME@:5984/$2$is_args$args;
}
location ~ ^/_(session|all_dbs)$ {
proxy_pass http://@DB_NAME@:5984$request_uri;
}
location ~ ^/page/([^/]*)/nedm/([^/]*)$ {
proxy_pass http://@DB_NAME@:5984@REDIRECT_URI@/page/$1/nedm%2F$2;
}
}
location /auth {
internal;
include uwsgi_params;
uwsgi_pass_request_body off;
uwsgi_pass unix:/tmp/wsgi.sock;
}
location /protected {
internal;
alias /database_attachments/;
}