server
{
listen 80;
server_name www.asb.com;
listen 443 ssl;
access_log off;
access_log /dev/null;
error_log /dev/null;
# index neindex.html index.html index.html;
# root /home/www/weihu.abc.com/;
# root /sas/tomcat_server/www17042/adad.adads.com/official/;
#error_page 404 /index.html;
location / {
rewrite ^(.*)$ /neindex.html break;
index neindex.html index.htm;
root /sas/tomcat_server/www17042/adadad.com/official/;
}
location ~* \.png$ {
# rewrite /img/bodyBg.png break;
alias /sas/tomcat_server/www17042/adadada.com/official/img/bodyBg.png;
}
}
初学 后续添加解释
official/index.html 无论域名添加什么后缀 都是重写到neindex.html
然后就是无论是什么图片 只要是png结尾直接找alias 路径给的路径
网友评论