nginx.conf
如下配置为啥不生效
location / {
root /usr/share/nginx/html/public;
index index.html index.htm;
}
location = /abc {
root /usr/share/nginx/html/abc;
index index.html;
}
# 或者
location /abc {
root /usr/share/nginx/html/abc;
index index.html;
}
location / {
root /usr/share/nginx/html/public;
index index.html index.htm;
}
访问域名根目录没什么问题,域名根目录/abc貌似映射失败404啊,网上搜的这么配都不行啊
还有为啥每次sudo systemctl restart nginx再sudo systemctl status nginx都报这个错
Can't open PID file /var/run/nginx/nginx.pid (yet?) after start: No such file or directory
实际上这个路径下是有nginx.pid的,默认是/var/run/nginx.pid,改了加了一层/nginx,第一次重启不报错了,现在又还是这样,这是什么原理啊,大佬们谁知道.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…