nginx: [emerg] unknown directive "?server" in /etc/nginx/conf.d/nginx.conf:1

问题描述:启动nginx的时候报错

 1、nginx: [warn] the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:2

 2、nginx: [emerg] unknown directive "?server" in /etc/nginx/conf.d/nginx.conf:1

nginx: [emerg] unknown directive "?server" in /etc/nginx/conf.d/nginx.conf:1

 

 解决方案:

 1、这个是启动用户权限不足,可以sudo执行,或者给nginx文件加755权限

 2、这个一般是空格编码问题,可用cat -A nginx.conf 检查下空格(windows复制粘贴到linux上常出现这种问题)删掉多余的,重新检查下

nginx: [emerg] unknown directive "?server" in /etc/nginx/conf.d/nginx.conf:1

 

nginx: [emerg] unknown directive "?server" in /etc/nginx/conf.d/nginx.conf:1

上一篇:ValueError: check_hostname requires server_hostname解决方案


下一篇:在Windows部署swoole