allgo.conf.template 1.69 KB
Newer Older
1
2
3
4
upstream django
{
	server 127.0.0.1:8000  fail_timeout=0;
}
5
6
7
8
upstream aio
{
	server 127.0.0.1:8001  fail_timeout=0;
}
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

server
{
  listen		8080;

  client_max_body_size 1G;
  client_body_in_file_only clean;
  client_body_buffer_size 32K;

  # registry endpoints
  # - forwarded to the registry
  # - except manifest push/pull -> forwarded through the django server (to
  #   guarantee that the db is transactionally updated)
  location /v2/
  {
	proxy_pass	{ALLGO_REGISTRY_PRIVATE_URL}/v2/;
	proxy_redirect  off;
	proxy_buffering	off;

	location ~ ^/v2/.*/manifests/[^/]*$ {
29
		proxy_pass	http://aio;
30
31
32
	}
  }

33
34
35
36
37
38
39
40
  # allgo async endpoints
  location /aio/
  {
	proxy_pass	http://aio/aio/;
	proxy_redirect  off;
	proxy_buffering	off;
  }

41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

  location ~ /datastore/([0-9]+)/(.*)$ {
        autoindex on;
        auth_request     /auth;
        auth_request_set $auth_status $upstream_status;
        root /vol/rw/;
    }

    location = /auth {
        internal;
        proxy_pass              http://django/auth;
        proxy_redirect off;
        proxy_set_header        X-Original-URI $request_uri;
    }


57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
  # allgo endpoints
  # - static files served directly by nginx
  # - other requests forwarded to the django server
  location /
  {
	sendfile on;
	send_timeout 300s;

	keepalive_timeout 5;
	root /var/www/html;
	try_files $uri/index.html $uri.html $uri @django;
  }

  location @django
  {
    proxy_redirect off;
    proxy_pass http://django;
74
75
76
77
78
79
80

    # header set to distinguish between requests going directly from nginx and
    # requests going through aio
    #
    # This is a security feature. Django trusts this value (like the
    # X-Forwarded-* headers), do not remove it !
    proxy_set_header	X-Origin	"nginx";
81
  }
82
83
84


}