If you delete a package using e.g. pkg delete nginx
it will leave the configuration files behind. If you then delete /usr/local/etc/nginx
manually and reinstall the package using e.g. pkg install nginx
, it will not restore the default configs, because it thinks this is not the first install of said package on the system and you deleted the configs intentionally.
To reinstall the package with configs as if it was never installed, use -f
:
pkg delete -f nginx-lite
pkg install -f nginx-lite