L12※通过bind自建doh服务

2> 安装doh-server

docker run -itd --restart unless-stopped --network host --name doh-server \
  -e UPSTREAM_DNS_SERVER="udp:127.0.0.1:53" \
  -e DOH_HTTP_PREFIX="/dns-query" \
  -e DOH_SERVER_LISTEN="127.0.0.1:5253" \
  -e DOH_SERVER_TIMEOUT="10" \
  -e DOH_SERVER_TRIES="3" \
  -e DOH_SERVER_VERBOSE="true" \
  satishweb/doh-server

3> 修改nginx配置

server {
    listen 443 ssl http2 fastopen=256 reuseport;
    listen [::]:443 ssl http2 fastopen=256 reuseport;
    server_name doh.ubuntu.cn
    ...
    location /dns-query {
    proxy_redirect off;
    proxy_http_version 1.1;
    proxy_set_header Host $http_host;
    # show real IP
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass http://127.0.0.1:8053;
  }
}

1 2

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享