sites.j2 1.13 KB
Newer Older
1
2
3
4
5
6
7
8
9
10


server {
        listen 80;
        listen [::]:80;
        server_name {{ site.key }};
        root /var/www/{{ site.key }};
        index index.html;

    
hatsch's avatar
hatsch committed
11
12


13
14
    {% for key, value in site.value.endpoints.items() %}

hatsch's avatar
hatsch committed
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
##############     {{ value.key }}  #######################

        location /{{ key }}/ {
            alias /var/www/{{ site.key }}/player/{{ key }}/;
        }


        location /hls/{{ key }} {

            alias /var/www/{{ site.key }}/hls/{{ key }};
            types {
                application/vnd.apple.mpegurl m3u8;
                video/mp2t ts;
            }
                add_header Cache-Control no-cache;
                add_header Access-Control-Allow-Origin *;
                add_header Access-Control-Allow-Headers  accept;
                try_files $uri $uri/ =404;
      }

35
36
37
38
39
40
41
        location /auth/{{ key }}/{{ value.key }} {
        if ($arg_psk = '{{ value.secret }}') {
          return 201;
        }
          return 404;
        }

hatsch's avatar
hatsch committed
42
43
##############   END  {{ value.key }}  #######################

44
45
46
47
48
49
50
51
52
53
54
55
56
57
    {% endfor %}


    
        location / {

                try_files $uri $uri/ =404;
        }




}