[英]Docker Apache Proxy point to running Python Script
Hoping that someone can help me understand what I have done wrong in my setup. 希望有人可以帮我理解我在设置中做错了什么。 I have a Ubuntu Server set up with Docker.
我有一个使用Docker设置的Ubuntu服务器。 I have an Apache container(running on port 80) set up to run as a Proxy and use Virtual Hosts to point to a port dependent on domain name.
我有一个Apache容器(在端口80上运行)设置为作为代理运行,并使用虚拟主机指向依赖于域名的端口。
<VirtualHost *:80>
ServerName myDomain.com
ServerAlias www.myDomain.com
<Proxy *>
Allow from localhost
</Proxy>
ProxyPass / http://myDomain:8080/
</VirtualHost>
For a specific docker container, I have a python script running on port 80 (confirmed by going to SERVER_IP:PORT ) however when I go to the domain it only shows the default apache page (on the apache proxy container) 对于特定的docker容器,我有一个在端口80上运行的python脚本(通过转到SERVER_IP:PORT确认)但是当我进入域时它只显示默认的apache页面(在apache代理容器上)
I have also got other containers running LAMP stacks (with volume mapped to a folder on the apache proxy container. example /var/www/html
is mapped to /var/www/html/website.com
) and they work correctly. 我还有其他容器运行LAMP堆栈(其中卷映射到apache代理容器上的文件夹。示例
/var/www/html
映射到/var/www/html/website.com
)并且它们正常工作。
Does anyone have any ideas as to why I can't see the output of the python script at that domain but am able to when navigating to IP_ADDR:PORT ? 有没有人有任何想法,为什么我看不到该域的python脚本的输出,但能够导航到IP_ADDR:PORT ? All help and better ideas of a setup is appreciated!!
所有帮助和更好的设置的想法表示赞赏!! THANK YOU!!!
谢谢!!!
EDIT: Python script is running under /root/pythonscript/
could this be the cause? 编辑:Python脚本在
/root/pythonscript/
下运行/root/pythonscript/
这可能是原因吗?
I assume this is running on localhost? 我假设这是在localhost上运行的? so you want to collect on the domain but route to localhost?
所以你想收集域名但路由到localhost?
I also assume that the python script is running on port 8080? 我还假设python脚本在端口8080上运行? And that apache is running on port 80?
那个apache在80端口运行?
Try this 尝试这个
<VirtualHost *:80>
ServerName myDomain.com
ServerAlias www.myDomain.com
<Proxy *>
Allow from localhost
</Proxy>
ProxyPass / http://127.0.0.1:8080/
</VirtualHost>
OMG! 我的天啊! I am sorry to waste your time, stupid me didn't run
a2ensite domain.com.conf
before I reloaded apache2 service... I apologise... That has fixed the issue! 我很抱歉浪费你的时间,愚蠢的我没有运行
a2ensite domain.com.conf
之前我重新加载apache2服务...我道歉...这已经解决了问题!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.