Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用Traefik v2和HTTP-01挑战将domain.com重定向到www.domain.com?_Http_Web_Https_Lets Encrypt_Traefik - Fatal编程技术网

如何使用Traefik v2和HTTP-01挑战将domain.com重定向到www.domain.com?

如何使用Traefik v2和HTTP-01挑战将domain.com重定向到www.domain.com?,http,web,https,lets-encrypt,traefik,Http,Web,Https,Lets Encrypt,Traefik,我有一个域名:mydomain.com 我在www.mydomain.com下主持了一个博客,我想将使用mydomain.com的人重定向到www.mydomain.com 我的代理是traefik,我使用HTTP-01挑战来提供https,让我们加密 到目前为止,我的配置如下所示: “traefik.enable”:“true”, “traefik.http.routers.blogGateway.rule”:“主机(`www.mydomain.com`)| |主机(`mydomain.com

我有一个域名:
mydomain.com

我在
www.mydomain.com
下主持了一个博客,我想将使用
mydomain.com
的人重定向到
www.mydomain.com

我的代理是traefik,我使用
HTTP-01
挑战来提供
https
,让我们加密

到目前为止,我的配置如下所示:

“traefik.enable”:“true”,
“traefik.http.routers.blogGateway.rule”:“主机(`www.mydomain.com`)| |主机(`mydomain.com`)”,
“traefik.http.routers.blogGateway.entrypoints”:“web安全”,
“traefik.http.routers.blogGateway.tls.certresolver”:“HttpChallengeLetEncrypt”,
“traefik.http.routers.blogGateway.tls.domains[0].main”:“www.mydomain.com”,
“traefik.http.routers.blogGateway.tls.domains[1].main”:“mydomain.com”,
“traefik.http.middleware.redirect to https.redirectscheme.scheme”:“https”,
“traefik.http.routers.blogGatewayRedirs.rule”:“hostregexp(`{host:.+}`)”,
“traefik.http.routers.blogGatewayRedirs.entrypoints”:“web”,
“traefik.http.routers.blogGatewayRedirs.Middleware”:“重定向到https”
这是一项工作,但它公开了两个域而不是一个域

我试着按照本教程进行操作:但我一直无法跟踪我的更改,这个配置与我当前的配置完全不同

如何使用traefik v2执行从
@
www
的重定向