- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试调整可用的教程 here身份验证配置详见official Trafik documentation .
我创建了一个简单的服务,当收到此地址上的 GET 请求时,该服务始终响应 200 OK:http://172.27.10.56:9999/verify
然后,我更改了 traefik.toml,并添加了以下内容:
[entrypoints.http.auth.forward]
address = "http://172.27.10.56:9999/verify"
但是我的身份验证服务从未被调用。事实上,通过此配置,traefik 会停止重定向所有请求。
这是我的 Dockerfile:
FROM traefik:v1.4.1-alpine
ADD traefik.toml /traefik.toml
这是我的 traefik.toml
debug = true
logLevel = "DEBUG"
defaultEntryPoints = ["http"]
[entryPoints]
[entryPoints.http]
address = ":80"
[entrypoints.http.auth.forward]
address = "http://172.27.10.56:9999/verify"
[web]
address = ":8080"
[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "docker.localhost"
watch = true
这是我的 docker-compose.yaml
traefik:
image: dsp/traefik
ports:
- "80:80"
- "8080:8080"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
machine:
image: katacoda/docker-http-server
labels:
- "traefik.backend=machine-echo"
- "traefik.frontend.rule=Host:machine-echo.example.com"
echo:
image: katacoda/docker-http-server:v2
labels:
- "traefik.backend=echo"
- "traefik.frontend.rule=Host:echo-echo.example.com"
这是 traefik 启动的输出:
time="2017-10-26T15:00:17Z" level=info msg="Using TOML configuration file //traefik.toml"
time="2017-10-26T15:00:17Z" level=info msg="Traefik version v1.4.1 built on 2017-10-24_05:25:28PM"
time="2017-10-26T15:00:17Z" level=debug msg="Global configuration loaded {"GraceTimeOut":10000000000,"Debug":true,"CheckNewVersion":true,"AccessLogsFile":"","AccessLog":null,"TraefikLogsFile":"","LogLevel":"DEBUG","EntryPoints":{"http":{"Network":"","Address":"","TLS":null,"Redirect":null,"Auth":{"Basic":null,"Digest":null,"Forward":{"Address":"http://172.27.10.56:9999/verify","TLS":null,"TrustForwardHeader":false},"HeaderField":""},"WhitelistSourceRange":null,"Compress":false,"ProxyProtocol":null,"ForwardedHeaders":{"Insecure":true,"TrustedIPs":null}}},"Cluster":null,"Constraints":[],"ACME":null,"DefaultEntryPoints":["http"],"ProvidersThrottleDuration":2000000000,"MaxIdleConnsPerHost":200,"IdleTimeout":0,"InsecureSkipVerify":false,"RootCAs":null,"Retry":null,"HealthCheck":{"Interval":30000000000},"RespondingTimeouts":null,"ForwardingTimeouts":null,"Docker":{"Watch":true,"Filename":"","Constraints":null,"Trace":false,"DebugLogGeneratedTemplate":false,"Endpoint":"unix:///var/run/docker.sock","Domain":"docker.localhost","TLS":null,"ExposedByDefault":true,"UseBindPortIP":false,"SwarmMode":false},"File":null,"Web":{"Address":":8080","CertFile":"","KeyFile":"","ReadOnly":false,"Statistics":null,"Metrics":null,"Path":"/","Auth":null,"Debug":false,"CurrentConfigurations":null,"Stats":null,"StatsRecorder":null},"Marathon":null,"Consul":null,"ConsulCatalog":null,"Etcd":null,"Zookeeper":null,"Boltdb":null,"Kubernetes":null,"Mesos":null,"Eureka":null,"ECS":null,"Rancher":null,"DynamoDB":null}"
time="2017-10-26T15:00:17Z" level=info msg="Preparing server http &{Network: Address: TLS:<nil> Redirect:<nil> Auth:0xc4204da780 WhitelistSourceRange:[] Compress:false ProxyProtocol:<nil> ForwardedHeaders:0xc4202a07c0} with readTimeout=0s writeTimeout=0s idleTimeout=3m0s"
time="2017-10-26T15:00:17Z" level=info msg="Starting provider *docker.Provider {"Watch":true,"Filename":"","Constraints":null,"Trace":false,"DebugLogGeneratedTemplate":false,"Endpoint":"unix:///var/run/docker.sock","Domain":"docker.localhost","TLS":null,"ExposedByDefault":true,"UseBindPortIP":false,"SwarmMode":false}"
time="2017-10-26T15:00:17Z" level=info msg="Starting server on "
time="2017-10-26T15:00:17Z" level=info msg="Starting provider *web.Provider {"Address":":8080","CertFile":"","KeyFile":"","ReadOnly":false,"Statistics":null,"Metrics":null,"Path":"/","Auth":null,"Debug":true,"CurrentConfigurations":{},"Stats":{"Uptime":"2017-10-26T15:00:17.777369487Z","Pid":1,"ResponseCounts":{},"TotalResponseCounts":{},"TotalResponseTime":"0001-01-01T00:00:00Z"},"StatsRecorder":null}"
time="2017-10-26T15:00:17Z" level=debug msg="Provider connection established with docker 17.10.0-ce-rc1 (API 1.33)"
time="2017-10-26T15:00:17Z" level=debug msg="Validation of load balancer method for backend backend-echo failed: invalid load-balancing method ''. Using default method wrr."
time="2017-10-26T15:00:17Z" level=debug msg="Validation of load balancer method for backend backend-machine-echo failed: invalid load-balancing method ''. Using default method wrr."
time="2017-10-26T15:00:17Z" level=debug msg="Validation of load balancer method for backend backend-traefik-traefik failed: invalid load-balancing method ''. Using default method wrr."
time="2017-10-26T15:00:17Z" level=debug msg="Configuration received from provider docker: {"backends":{"backend-echo":{"servers":{"server-traefik_echo_1":{"url":"http://172.17.0.2:80","weight":0}},"loadBalancer":{"method":"wrr"}},"backend-machine-echo":{"servers":{"server-traefik_machine_1":{"url":"http://172.17.0.3:80","weight":0}},"loadBalancer":{"method":"wrr"}},"backend-traefik-traefik":{"servers":{"server-traefik_traefik_1":{"url":"http://172.17.0.4:80","weight":0}},"loadBalancer":{"method":"wrr"}}},"frontends":{"frontend-Host-echo-echo-example-com":{"entryPoints":["http"],"backend":"backend-echo","routes":{"route-frontend-Host-echo-echo-example-com":{"rule":"Host:echo-echo.example.com"}},"passHostHeader":true,"priority":0,"basicAuth":[],"headers":{}},"frontend-Host-machine-echo-example-com":{"entryPoints":["http"],"backend":"backend-machine-echo","routes":{"route-frontend-Host-machine-echo-example-com":{"rule":"Host:machine-echo.example.com"}},"passHostHeader":true,"priority":0,"basicAuth":[],"headers":{}},"frontend-Host-traefik-traefik-docker-localhost":{"entryPoints":["http"],"backend":"backend-traefik-traefik","routes":{"route-frontend-Host-traefik-traefik-docker-localhost":{"rule":"Host:traefik.traefik.docker.localhost"}},"passHostHeader":true,"priority":0,"basicAuth":[],"headers":{}}}}"
time="2017-10-26T15:00:17Z" level=debug msg="Last docker config received more than 2s, OK"
time="2017-10-26T15:00:17Z" level=debug msg="Creating frontend frontend-Host-echo-echo-example-com"
time="2017-10-26T15:00:17Z" level=debug msg="Wiring frontend frontend-Host-echo-echo-example-com to entryPoint http"
time="2017-10-26T15:00:17Z" level=debug msg="Creating route route-frontend-Host-echo-echo-example-com Host:echo-echo.example.com"
time="2017-10-26T15:00:17Z" level=debug msg="Creating backend backend-echo"
time="2017-10-26T15:00:17Z" level=debug msg="Creating load-balancer wrr"
time="2017-10-26T15:00:17Z" level=debug msg="Creating server server-traefik_echo_1 at http://172.17.0.2:80 with weight 0"
time="2017-10-26T15:00:17Z" level=debug msg="Creating frontend frontend-Host-machine-echo-example-com"
time="2017-10-26T15:00:17Z" level=debug msg="Wiring frontend frontend-Host-machine-echo-example-com to entryPoint http"
time="2017-10-26T15:00:17Z" level=debug msg="Creating route route-frontend-Host-machine-echo-example-com Host:machine-echo.example.com"
time="2017-10-26T15:00:17Z" level=debug msg="Creating backend backend-machine-echo"
time="2017-10-26T15:00:17Z" level=debug msg="Creating load-balancer wrr"
time="2017-10-26T15:00:17Z" level=debug msg="Creating server server-traefik_machine_1 at http://172.17.0.3:80 with weight 0"
time="2017-10-26T15:00:17Z" level=debug msg="Creating frontend frontend-Host-traefik-traefik-docker-localhost"
time="2017-10-26T15:00:17Z" level=debug msg="Wiring frontend frontend-Host-traefik-traefik-docker-localhost to entryPoint http"
time="2017-10-26T15:00:17Z" level=debug msg="Creating route route-frontend-Host-traefik-traefik-docker-localhost Host:traefik.traefik.docker.localhost"
time="2017-10-26T15:00:17Z" level=debug msg="Creating backend backend-traefik-traefik"
time="2017-10-26T15:00:17Z" level=debug msg="Creating load-balancer wrr"
time="2017-10-26T15:00:17Z" level=debug msg="Creating server server-traefik_traefik_1 at http://172.17.0.4:80 with weight 0"
time="2017-10-26T15:00:17Z" level=info msg="Server configuration reloaded on "
当我测试 Traefik 时,输出如下:
curl -H Host:machine-echo.example.com http://127.0.0.1
curl: (56) Recv failure: Connection reset by peer
但是,当我从 traefik.toml 中删除前向身份验证配置时,请求已成功重定向到 docker 容器:
curl -H Host:machine-echo.example.com http://127.0.0.1
<h1>This request was processed by host: 2a291e3bb05f</h1>
可能出了什么问题?
最佳答案
文档中似乎有拼写错误。我花了一段时间才弄清楚:
[entrypoints.http.auth.forward]
应该是:
[entryPoints.http.auth.forward]
“entryPoints”中的大写“P”
关于Traefik:转发身份验证不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46957944/
我在正在构建的应用程序中集成了转发系统,但很难弄清楚在同一流中检索帖子和转发的逻辑。 我有一个 post_reblog 数据透视表来存储 post_id 和 user_id - 转发该帖子的用户的 I
好的,由于阅读了数百本手册和说明页但仍然没有得到它,我正处于某个时刻,我觉得自己非常愚蠢。我希望你能帮帮我! 我有一台运行 Ubuntu Server 的服务器。在服务器上,我正在运行 ddclien
我在我的项目中使用嵌入 jetty 并提出了一些问题。我有这两页: íindex.jsp 结果.jsp 这两个 servlet: 上传 搜索 在 íindex.jsp 中有一个用于上传文件的表单,上传
我正在使用 c# asp.net 创建一个基于 Web 的电子邮件客户端。 令人困惑的是,各种电子邮件客户端在回复电子邮件时似乎以多种不同方式添加原文。 我想知道的是,是否有某种标准化的方式来消除这个
我正在开发一个评估系统,让考生尝试参加考试。因此,呈现问题及其选择的页面是带有 iframe 的页面,在该页面中呈现问题。包含 iframe 的页面包含 JavaScript 计时器。 因此,当问题在
QOTD(每日问题)的 Twilio 新手。我认为这应该是非常基本的,但我似乎找不到答案。 我成功地将一个电话号码转发到我的手机上……很简单……但问题是我经营着几家公司,我想将号码转发到我的手机上。问
我正在尝试在 pod 上公开一个端口 8080,这样我就可以直接从服务器获取 wget。使用端口转发一切正常(kubectl --namespace jenkins port-forward pods
我想转发一个 url,这样如果你在地址栏中输入 www.example.com,你就会被转发到 www.test.com/test.php。 我所做的是在我的区域文件中添加了一个 cname 记录。
我正在尝试在构建 docker 镜像时克隆一个私有(private) github 存储库。我安装了 docker 18.09.2 并根据 Build secrets and SSH forwardi
Grails 2.2.0 我正在探索grails和ajax,也许我是一个狂热的ajax适配器,但是我确实认为它是一个改变游戏规则的人,所以我要走在前面。 数据模型是主要细节(1:n)。客户端中的一个表
Tumblr API似乎不支持帖子的某些细节:评论、转发或点赞的数量。 真的没有办法从每个帖子的 Tumblr API 获取这个吗? 最佳答案 tumblr API 在报告笔记的方式上非常有限。它可以
我正在制作一个greasemonkey脚本,我想要一个链接来前进并修改当前的html并允许用户单击返回以转到原始页面。 我该怎么做?使用jquery+greasemonkey+javascript。主
我的包含文件有一个小问题,我已经对我的问题做了一个简化的模型。假设我正在编译一些需要名为的头文件的源代码 header.h 里面有: #ifndef HEADER_INCLUDED #define H
我遇到了一个奇怪的问题。我有一个自定义组件来为我处理 UICollectionView 的布局。该代码是用 Swift 编写的。 class MyCustomCollectionViewHandler
有什么方法可以导出命令输出的颜色吗? 让我们用一个小例子来解释它: ls -alh --color=auto 将打印目录的彩色内容,而 ls -alh --color=auto | cat 不会打印一
我希望能够转发 url,例如 http://external_url.com/auth => http://internal_url.com:8080/app/auth https://externa
我有一个在 nginx 中混合运行 PHP 和 Tomcat 的域。这是它的样子。我在这个站点上有一个域 example.com 我安装了 Wordpress。这完全没有问题。现在我想要的是,当您导航
我在一种模板化的层次结构中有一堆相关的指标,看起来像 template struct index{ index w; int x, y; }; template <> struct
我之前发布了有关使用Processing与Leap Motion的文章https://www.leapmotion.com/为了构建一个可以检测手颤的应用程序。我相信我需要执行 FFT 才能实现此目的
Peer 必须能够转发数据,以便在点对点覆盖(例如 Chord)中进行广播。当每个节点(对等体)接收到数据时,它会将数据转发到其路由表中的所有其他节点,然后这些节点将再次转发相同的数据,直到环中的所有
我是一名优秀的程序员,十分优秀!