nginx 添加到环境变量中

nginx热启动命令

nginx -s reload

报错
-bash: nginx: command not found
一般通过执行/usr/local/nginx/sbin/nginx -s reload,每次都要去找目录比较麻烦,所以吧nginx配置到环境变量里用nginx之类执行指令

步骤如下:
1、编辑/etc/profile

vim /etc/profile

2、在最后一行添加配置,:wq保存

PATH=$PATH:/usr/local/nginx/sbin
export PATH

3、使配置立即生效

source /etc/profile

原文地址:https://www.cnblogs.com/nickchou/p/12582441.html