我目前有一对docker容器在一个节点上运行,其中两个是Apache Web服务器,我configuration了一个反向代理和Portainer,允许我通过GUIpipe理我的容器。
我已经尝试跟随这个线程: https : //github.com/portainer/portainer/issues/488,但已经无法将stream量从Apache转发到Portainer。
这是我的httpd.conf文件:
<Location /portainer/> AuthBasicProvider ldap AuthLDAPURL someldap AuthType Basic AuthName SomeAuthName require valid-user </Location> ProxyPass /portainer/api/websocket/ ws://172.18.0.8:9000/api/websocket/ </VirtualHost>
有任何想法吗?
谢谢!
我通常不会build议在Location中添加proxypass指令,但是由于您的位置已经影响到相同的URI,所以Location可能会覆盖ProxyPass,因为在虚拟主机上下文中定义了一个,而位置本身在这种情况下是虚拟主机的子上下文。它正在压倒虚拟主机。 因此,请先尝试定义ProxyPass指令,或尝试在Location中定义ProxyPass,如下所示:
<Location /portainer/> AuthBasicProvider ldap AuthLDAPURL someldap AuthType Basic AuthName SomeAuthName require valid-user </Location> <Location /portainer/api/websocket/> ProxyPass ws://172.18.0.8:9000/api/websocket/ </Location>
定义Location的正确顺序首先是更多的全局path,然后是特定的path(与proxypass正好相反),所以如果你这样定义它,或者像我之前提到的那样,确定一个不会重叠另一个,可能定义proxypass指令在位置之上。
请记住,您可能在合并configuration时遇到问题。