怎么添加虚拟主机
server{
listen 80;
#listen [::]:80 default_server ipv6only=on;
server_name api.first.cn;
index index.html index.htm index.php;
root/home/wwwroot/api.first.cn/public;
#error_page 404 /404.html;
include enable-php.conf;
location /nginx_status
{
stub_status on;
access_log on;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /\.
{
allow all;
}
access_log/home/wwwlogs/access_check.log;
}
在/home/wwwroot/建了个api.first.cn目录,在vhost下加了个api.first.conf,结果还是指向原来的目录 自己看官网教程 https://lnmp.org/faq/lnmp-vhost-add-howto.html
页:
[1]