Skip to content

Instantly share code, notes, and snippets.

@fcicq
Last active May 3, 2020 05:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fcicq/d418345e3695e12d5737ad3f6fe4c7c7 to your computer and use it in GitHub Desktop.
Save fcicq/d418345e3695e12d5737ad3f6fe4c7c7 to your computer and use it in GitHub Desktop.
minimal nginx stream config, replace TARGET / LISTEN first. nginx -c PATH/to/conf
worker_processes 1; master_process off; daemon off; error_log /dev/null; pid /dev/null;
load_module /usr/lib/nginx/modules/ngx_stream_module.so;
events {}
stream { upstream u { server TARGET max_fails=0; server TARGET max_fails=0; } server { listen LISTEN; proxy_pass u; }}
@fcicq
Copy link
Author

fcicq commented May 3, 2020

T=$(mktemp); [ -f $T ] && cat <<EOF >$T
blah
EOF
sed -i -e 's/TARGET//g' -e 's/LISTEN/PORT/' $T;
nginx -c $T
rm $T

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment