DNS-aggregators-golang-fastly-compute
软件架构说明
对于dns请求使用了fastly compute的cdn缓存.
-
fastly compute serve
-
fastly compute deploy
Get to know the Fastly Compute environment with a basic starter that demonstrates routing, simple synthetic responses and code comments that cover common patterns.
For more details about other starter kits for Compute, see the Fastly Documentation Hub
- Allow only requests with particular HTTP methods
- Match request URL path and methods for routing
- Build synthetic responses at the edge
This starter is intentionally lightweight, and requires no dependencies aside
from the
"github.com/fastly/compute-sdk-go/fsthttp"
repo. It will help you understand the basics of processing requests at the edge
using Fastly. This starter includes implementations of common patterns explained
in our using Compute
and
VCL migration
guides.
The starter doesn't require the use of any backends. Once deployed, you will have a Fastly service running on Compute that can generate synthetic responses at the edge.
It is recommended to use the Fastly CLI for
this template. The template uses the fastly.toml
scripts, to allow for
building the project using your installed Go compiler. The Fastly CLI should
also be used for serving and testing your build output, as well as deploying
your finalized package!
Please see our SECURITY.md for guidance on reporting security-related issues.
在resources的secret-stores
里面设置名称为"DNS-aggregators-golang-fastly-compute"的secret stores
里面的"DOH_ENDPOINT"为"https://doh.pub/dns-query",也可以是多个上游服务器的地址的json数组.
在resources的secret-stores
里面设置名称为"DNS-aggregators-golang-fastly-compute"的secret stores
里面的"DOH_PATHNAME"为"/dns-query".
访问 "http://127.0.0.1:7676/dns-query" 使用doh服务
设置源站的名称为上游服务器的域名
设置网站的Certificate hostname,SNI hostname,Override host为上游服务器的域名
在resources的secret-stores
里面设置名称为"DNS-aggregators-golang-fastly-compute"的secret stores
里面的"DOH_MINTTL"为"600".
为了解决浏览器对于cname记录重复的不兼容问题,需要把cname记录进行展平.还要把cname记录放在其他记录前面,不允许出现相同名字的cname记录.
如果只有一个或者以上的cname记录,则把cname记录放在其他记录前面,不允许出现相同名字的cname记录.把其他记录的名字都改成同一个