title: 【记录】阿里云函数计算搭建个人主页 urlname: -ji-lu--a-li-yun-han-shu-ji-suan-da-jian-ge-ren-zhu-ye date: 2023-08-31 19:10:07 index_img: https://api.limour.top/randomImg?d=2023-08-31 19:10:07
域名备案后,需要有 DNS 解析到对应的云服务商的国内服务器,并且有活跃的访问,才能避免被撤销备案。而阿里云的服务器太贵了,因此只能在函数计算上挂一个主页来保持备案不掉。用到的主页项目是 KZHomePage。
location ~ ^/(\d+)\.html$ {
return 301 https://b.limour.top$request_uri;
}
location ~ ^/(?!static)[a-zA-Z0-9-]*-[a-zA-Z0-9-]+(.html)?$ {
return 301 https://hexo.limour.top$request_uri;
}
location / {
gzip on;
gzip_min_length 256;
gzip_comp_level 9;
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png application/vnd.ms-fontobject font/ttf font/opentype font/x-woff image/svg+xml;
gzip_vary on;
gzip_buffers 32 4k;
root /data/KZhome;
try_files $uri /index.html;
}