当我尝试启动NGINX时,我得到" nginx.service的作业失败。请参阅&system;系统状态nginx.service'和' journalctl -xn'详情。"
NGINX错误日志:
2017/01/03 03:08:05 [emerg] 15144#0: unknown directive "index.php" in /etc/nginx/sites-enabled/default:33
2017/01/03 03:09:25 [emerg] 15214#0: unknown directive "index.php" in /etc/nginx/sites-enabled/default:33
2017/01/03 03:09:48 [emerg] 15224#0: unknown directive "index.php" in /etc/nginx/sites-enabled/default:33
2017/01/03 03:10:44 [emerg] 15237#0: unknown directive "index.php" in /etc/nginx/sites-enabled/default:33
2017/01/03 03:11:18 [emerg] 15253#0: unknown directive "index.php" in /etc/nginx/sites-enabled/default:33
2017/01/03 03:13:25 [emerg] 15321#0: unknown directive "index.php" in /etc/nginx/sites-enabled/default:33
2017/01/03 03:14:04 [emerg] 15345#0: unknown directive "index.html" in /etc/nginx/sites-enabled/default:33
2017/01/03 03:15:40 [emerg] 15369#0: unknown directive "index.php" in /etc/nginx/sites-enabled/default:35
2017/01/03 03:16:28 [emerg] 15393#0: unknown directive "index.php" in /etc/nginx/sites-enabled/default:37
2017/01/03 03:17:56 [emerg] 15421#0: unexpected "}" in /etc/nginx/sites-enabled/default:60
2017/01/03 03:18:25 [emerg] 15443#0: unexpected end of file, expecting ";" or "}" in /etc/nginx/sites-enabled/default:81
2017/01/03 03:19:14 [emerg] 15466#0: unexpected "}" in /etc/nginx/sites-enabled/default:80
2017/01/03 03:20:10 [emerg] 15489#0: unexpected "}" in /etc/nginx/sites-enabled/default:60
2017/01/03 03:22:06 [emerg] 15515#0: unexpected "}" in /etc/nginx/sites-enabled/default:60
默认CONG: http://pastebin.com/APZCBJ5n
答案 0 :(得分:0)
您应该将默认文件模式放在索引指令中,并且应该在 server_name 指令后添加逗号。
所以在第28和29行修改你的配置:
index index.php
server_name www.streamingeverywhere.com;
答案 1 :(得分:0)
更改
root /var/www/html;
# Add index.php to the list if you are using PHP
index.php
到
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.php
并且您还缺少;
指令的结尾,
在执行任何nginx配置更改后运行server_name
以检查是否有任何错误,然后再申请生产以重新启动/重新加载nginx进程!