服务器问答
自己就做了一个静态页面,设置了多个域名指向
如何设置 nginx,将多个域名的所有请求跳转到各自首页?
我自己改了宝塔的配置,貌似不行啊...请各位大神指点啊,感谢
server
{
listen 80;
server_name ABC.com XYZ.com 123.com www.ABC.com www.XYZ.com www.123.com *.ABC.com *.XYZ.com *.123.com;
rewrite ^/(.*) http://$host$1 permanent;
index index.php index.html index.htm default.php default.htm default.html;
root /www/wwwroot/ABC.com;
#REWRITE-START URL 重写规则引用,修改后将导致面板设置的伪静态规则失效
include /www/server/panel/vhost/rewrite/ABC.com.conf;
#REWRITE-END
#禁止访问的文件或目录
location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
{
return 404;
}
#一键申请 SSL 证书验证目录相关设置
location 抗投诉服务器~ \.well-known{
allow all;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
error_log off;
access_log /dev/null;
}
location ~ .*\.(js|css)?$
{
expires 12h;
error_log off;
access_log /dev/null;
}
access_log /www/wwwlogs/ABC.com.log;
error_log /www/wwwlogs/ABC.com.error.log;
}