nginx caching reverse proxy config
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. 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:
resolverandresolver_timeout(if you plan on using a domain name for the upstream)proxy_cache_pathupstream
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.