From 5d4f39b68bb5bf710baf7fa90ac6bf6698fb1ce3 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Fri, 1 Nov 2019 11:09:39 +0100 Subject: Add an example nginx config. --- nginx_config | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 nginx_config diff --git a/nginx_config b/nginx_config new file mode 100644 index 0000000..8c1f13e --- /dev/null +++ b/nginx_config @@ -0,0 +1,64 @@ +# an example config for running nginx with dash_server.py as the backend + +# define connection to dash_server.py +upstream dash_server_py { + server [::1]:8000; +} + +server { + # network config + listen [::]:80 default_server; + + # tweak to your site and uncomment for TLS + #listen [::]:443 ssl; + #ssl_certificate ; + #ssl_certificate_key ; + #ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH'; + #ssl_dhparam ; + # optional, verify the client certificate for authenticated uploading + #ssl_verify_client optional; + #ssl_client_certificate ; + #if ($request_method ~ ^(POST|PUT)$) { + # set $reject "1"; + #} + #if ($ssl_client_verify = "SUCCESS") { + # set $reject "0"; + #} + #if ($reject = "1") { + # return 403; + #} + + server_name dash; + + root ; + + index index.html; + + # define parameters for communicating with dash_server.py + # enable chunked transfers + proxy_http_version 1.1; + proxy_buffering off; + proxy_request_buffering off; + # finish the upload even if the client does not bother waiting for our + # response + proxy_ignore_client_abort on; + + add_header Access-Control-Allow-Origin *; + + location / { + try_files $uri $uri/ =404; + } + + location /live/ { + + limit_except GET { + proxy_pass http://dash_server_py; + } + + try_files $uri @dash_server; + } + + location @dash_server { + proxy_pass http://dash_server_py; + } +} -- cgit v1.2.3