You have openresty (or nginx) running locally and you're editing the config. You want to reload the nginx process automatically every time you save the config file. You may also auto reload when you save a lua script file.
It assumes you have a the following directory structure but you can easily modify the commands to suit your setup:
./Makefile
./conf/your-confs.conf
./lib/your-lua-libs.lua
./openresty/ -- Your openresty PWD
./software/nginx/ -- Your nginx binaries (I install them with stow in /software/stow/openresty-19.15.1/)
If your config has an error ([emerg]
-type error) it will create an on screen notification (may be Ubuntu only)
The Makefile shown runs the nginx command and creates a watcher process that reloads every time you save the config file in your editor:
make run
And in a separate terminal:
make auto-reload
Currently this is Linux (ubuntu) only, but it shouldn't be difficult to adapt this for MacOS.