aboutsummaryrefslogtreecommitdiff
path: root/src/app/nginx.conf
blob: 06f4ad72fed8d68c6ffc80009e7d36d376ea7db3 (plain)
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
57
58
59
load_module modules/ngx_http_js_module.so;

events {  }

http {
    js_engine qjs;
    js_path "/etc/nginx/njs/";

    js_import main from app.js;
    js_set $dec_foo main.decode_uri;

    server {
        listen 80;

        location = /version {
            js_content main.version;
        }

        location / {
            js_content main.hello;
        }

        location /zoo {
            return 200 "$arg_zoo";
        }

        location /dec_foo {
            return 200 "$dec_foo";
        }

        location /join {
            js_content main.join;
        }

        location /foo {
            proxy_pass http://localhost:8080;
        }

        location /bar {
            proxy_pass http://localhost:8090;
        }
    }

    server {
        listen 8080;

        location / {
            return 200 "FOO";
        }
    }

    server {
        listen 8090;

        location / {
            return 200 "BAR";
        }
    }
}