aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2019-11-01 11:09:39 +0100
committerAnton Khirnov <anton@khirnov.net>2019-11-01 11:09:39 +0100
commit5d4f39b68bb5bf710baf7fa90ac6bf6698fb1ce3 (patch)
tree65f92c23402020616ee3ae639178518d9ee08bbd
parent1808ac3a8dbf31f3a223d89d4498f7a3591c2773 (diff)
Add an example nginx config.
-rw-r--r--nginx_config64
1 files changed, 64 insertions, 0 deletions
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 <path to TLS cert>;
+ #ssl_certificate_key <path to TLS key>;
+ #ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
+ #ssl_dhparam <path to DH params, optional>;
+ # optional, verify the client certificate for authenticated uploading
+ #ssl_verify_client optional;
+ #ssl_client_certificate <path to CA for client certs>;
+ #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 <path to site 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;
+ }
+}