# 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; } # this server handles media ingest # authentication is handled throught TLS client certificates server { # network config listen [::]:8001 ssl default_server; server_name ; # server's TLS cert+key ssl_certificate ; ssl_certificate_key ; #ssl_dhparam ; # source authentication with TLS client certificates ssl_client_certificate ; ssl_verify_client on; # only allow upload requests if ($request_method !~ ^(POST|PUT|DELETE)$) { return 405; # Method Not Allowed } root ; # 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; location /live/ { proxy_pass http://dash_server_py; } } server { # network config listen [::]:80 default_server; server_name ; # tweak to your site and uncomment for TLS #listen [::]:443 ssl; #ssl_certificate ; #ssl_certificate_key ; #ssl_dhparam ; if ($request_method !~ ^(GET|HEAD)$) { return 405; # Method Not Allowed } 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/ { try_files $uri @dash_server; } location @dash_server { proxy_pass http://dash_server_py; } }