0
点赞
收藏
分享

微信扫一扫

nginx把非一级域名转发到域名

杰森wang 2023-01-12 阅读 35



把所有二级域名转发到 一级域名


server 
{
listen 80;
#listen [::]:80;
server_name *.hapu.net;
rewrite ^(.*) http://hapu.net/$1 permanent;
}

server
{
listen 80;
#listen [::]:80;
server_name hapu.net;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/hapu.net;

include none.conf;
#error_page 404 /404.html;
include enable-php.conf;

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}

location ~ .*\.(js|css)?$
{
expires 12h;
}

location ~ /\.
{
deny all;
}

access_log off;
}



举报

相关推荐

0 条评论