nginx -p xxx -c xxx發生了什么
nginx -p aaa -c xxx.conf
nginx回去指定[aaa]目錄下,查找xxx.conf配置文件
xxx.conf中的log路徑,會在aaa/xxx/xxx.log中生成
# 在自己的家目錄下創建ccc文件夾
mkdir ccc
# 執行-p和-c
nginx -p ./ccc/ -c nginx.conf
# 發現報錯了,提示./ccc/logs/error.log和./ccc/nginx.conf沒有這幾個文件,
nginx: [alert] could not open error log file: open() "./ccc/logs/error.log" failed (2: No such file or directory)
2022/03/28 11:28:00 [emerg] 15363#0: open() "./ccc/nginx.conf" failed (2: No such file or directory)
# 復制原來的
cp -r /usr/local/temgine/logs ~/ccc
cp /usr/local/temgine/nginx.conf ~/ccc