在我编辑了我的nginx的nginx.conf并执行test命令后,出现了一个命令not found错误

时间:2016-12-29 16:51:22

标签: java nginx

今天我执行了/use/local/nginx/conf/nginx.conf -t to nginx,但它显示以下错误:

[root@ddqcsAPP ~]# /usr/local/nginx/conf/nginx.conf -t
/usr/local/nginx/conf/nginx.conf: line 3: worker_processes: command not found 
/usr/local/nginx/conf/nginx.conf: line 9: pid: command not found 
/usr/local/nginx/conf/nginx.conf: line 12: events: command not found 
/usr/local/nginx/conf/nginx.conf: line 13: worker_connections: command not found 
/usr/local/nginx/conf/nginx.conf: line 14: syntax error near unexpected token }' 
/usr/local/nginx/conf/nginx.conf: line 14: }'

我最后一次记得我能成功地执行它。什么可能出错?

1 个答案:

答案 0 :(得分:0)

这与Java无关。您正在尝试使用nginx配置检查选项,但您使用它是错误的。

您只需调用nginx -t(nginx命令)来测试您的配置,而不是尝试运行实际的配置文件。 :)