nginx: [emerg] “location“ directive is not allowed here in /usr/local/nginx/conf/:72

时间:2025-03-18 21:01:50

做LNMP实验中的PHP设置完测试页面重启nginx时发现重不不成用nginx -t检测说如下原因
nginx: [emerg] “location” directive is not allowed here in /usr/local/nginx/conf/:72
解决办法 原来是我之前做虚拟主机基于IP地址端口号时没有把配置文件改过来,就直接去把之前做的实验更改一下在重启就好了