Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.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
apache2反向代理到docker容器403禁止?_Apache_Docker_Proxy_Apache2_Reverse - Fatal编程技术网

apache2反向代理到docker容器403禁止?

apache2反向代理到docker容器403禁止?,apache,docker,proxy,apache2,reverse,Apache,Docker,Proxy,Apache2,Reverse,我已经在Ubuntu 18.04上的VPS上设置了apache2-我有SSL证书问题,但无论如何,我已经将默认配置设置为反向代理到不安全的docker容器,当前正在运行一个测试节点应用程序(我希望最终使用.net core)。以下是配置文件中的设置: <VirtualHost 77.68.7.249:443> ServerName www.thegatehousewereham.com ServerAlias *.thegate

我已经在Ubuntu 18.04上的VPS上设置了apache2-我有SSL证书问题,但无论如何,我已经将默认配置设置为反向代理到不安全的docker容器,当前正在运行一个测试节点应用程序(我希望最终使用.net core)。以下是配置文件中的设置:

    <VirtualHost 77.68.7.249:443>
            ServerName www.thegatehousewereham.com
            ServerAlias *.thegatehousewereham.com
            ServerAdmin webmaster@thegatehousewereham.com

            ProxyPreserveHost On
            ProxyPass / http://localhost:8000/
            ProxyPassReverse / http://localhost:8000/

            <Proxy http://localhost:8000/*>
              Order deny,allow
              Allow from all
            </Proxy>

服务器名www.thegatehousereham.com
服务器别名*.thegatehousereham.com
服务器管理员webmaster@thegatehousewereham.com
代理主机
ProxyPass/http://localhost:8000/
ProxyPassReverse/http://localhost:8000/
命令拒绝,允许
通融
我在浏览器中得到一个403禁止-在error.log中我看到:

[星期二1月21日20:56:11.109712 2020][authz_core:error][pid 1251:tid 140677341959936][client 94.197.37.81:53133]AH01630:客户端被服务器配置拒绝:代理: [星期二1月21日20:56:11.216718 2020][authz_core:error][pid 1251:tid 140677493028608][client 94.197.37.81:53133]AH01630:客户端被服务器配置拒绝:代理:,引用者: r

这可能是防火墙问题吗

谢谢你的帮助。在这上面花了太长时间,只想继续下去。 谢谢 安迪

更新:我使用的是Apache2.4,我不确定该代理指令。我把它改成了

            <Proxy http://localhost:8000/*>
              Require all granted
            </Proxy>

要求所有授权
现在我看到了:

[星期二1月21日21:57:01.084817 2020][proxy:warn][pid 6618:tid 139968717412096][client 94.197.37.81:54689]AH01144:URL/(方案“http”)没有有效的协议处理程序。如果您使用的是DSO版本的mod_proxy,请确保使用LoadModule的配置中包含代理子模块。 [星期二1月21日21:57:01.169791 2020][proxy:warn][pid 6618:tid 139968709019392][client 94.197.37.81:54688]AH01144:URL/favicon.ico(方案“http”)没有有效的协议处理程序。如果您使用的是DSO版本的mod_proxy,请确保使用LoadModule.的配置中包含代理子模块。请参阅:


我不确定这是否是一个改进,但它是不同的。

好的,所以使用适当的代理方案让我有所收获-我想确保我已经启用了模块Proxy、Proxy\u http和Proxy\u balancer-前两个模块已经启用了-第三个“表示”已经启用,但这是输出:

a2enmod代理_平衡器 考虑代理\u平衡器的依赖代理: 模块代理已启用 正在考虑代理\u平衡器的依赖别名: 模块别名已启用 考虑代理平衡器的依赖项slotmem\u shm: 启用模块slotmem\u shm。 启用模块代理\u平衡器。 要激活新配置,您需要运行: systemctl重新启动apache2

现在它似乎工作正常-我看到应用程序正常,都在SSL下。我们来看看接下来会发生什么