lnmp添加网站(虚拟主机)后域名无法访问指定目录
在/usr/local/nginx/conf/vhost/已经存www.imooc.com.conf 内容为server{
listen 80;
#listen [::]:80;
server_namewww.imooc.com ;
index index.html index.htm index.php default.html default.htm default.php;
root/home/wwwroot/default/imooc_o2o/public;
include none.conf;
#error_page 404 /404.html;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
include enable-php.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
access_log/home/wwwlogs/y.log;
}
但是访问www.imooc.com后,还是出现lnmp安装成功后的页面
这边测试是正常的
如果显示lnmp默认页面一般是这几种原因:
配置文件有错误
配置文件添加后未生效
指向的目录下面是lnmp的默认页面
页:
[1]