nohup ./nginx 2>&1 >file &

nohup: 忽略 hang up 信号
2>&1 将stderr重定向到stdout

file 相当于 1>file 将stdout重定向到file,
&后台运行

相关文章: