Vercel 域名解析
域名添加
首先在vercel进行deploy之后,在setting中找到domain,直接添加自己的域名,接下来会提示需要添加的dns解析记录;不要直接解析到默认域名。
过多重定向
我是用cloudflare添加的dns记录,但浏览器一直显示too many redirects,打不开网页。经过搜索,vercel官方有相关问题的说明,大致是因为cloudflare和vercel都非常贴心地在http和https直接进行了一点切换,导致中间切换次数太多浏览器觉得你这玩意儿有问题。原文链接
原文的相关简要说明如下:
- Cloudflare is serving
https://example.comand making requests tohttp://example.comon Vercel. - Vercel identifies an unprotected request to
http://example.comand sends a 308 status code redirect tohttps://example.com. - Cloudflare will forward the redirect to the user. However, since the client is already on
https://example.com, it will generate a redirect to the same location, causing a loop.
解决方法:Cloudflare的SSL/TLS需要设定成full而不是auto。