From a92325eb46f5510d73f64f6e56ab69b752cf4707 Mon Sep 17 00:00:00 2001 From: Hizkia Felix Winata Date: Thu, 27 Jan 2022 21:02:42 +0800 Subject: [PATCH] doc(nginx): update readme --- scripts/nginx/README.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/scripts/nginx/README.md b/scripts/nginx/README.md index fa90ba0..2bcf6b7 100644 --- a/scripts/nginx/README.md +++ b/scripts/nginx/README.md @@ -2,4 +2,22 @@ Check the `restream.conf` file for a good-enough caching reverse proxy setup with nginx. It should just work with the default nginx that ships with most -distros. +distros. It can be copied straight to `/etc/nginx/nginx.conf` and it _should_ +just work. + +If you want to merge it with an existing nginx config, you can copy these +directives to the `http` block: + +- `resolver` and `resolver_timeout` (if you plan on using a domain name for the + upstream) +- `proxy_cache_path` +- `upstream` + +And then you can copy the `server` block in too. If you want to merge it with an +existing `server`, you can just copy all the `proxy_` directives. Note that +it'll add caching to the whole `server` by default, so if you don't want that, +you can change `proxy_cache` to `off`, and then in the `location` blocks where +you do the reverse proxy, set `proxy_cache` back to `restream_cache`. + +Feel free to tweak the parameters to fit your needs, but generally the values in +`restream.conf` should just work alright for caching live streams.