docker - Apache2(httpd)反向代理无法与 Docker Compose 上的 SonarQube 服务器一起使用
问题描述
我在 apache 中的反向代理(CentOS 8 中的 httpd)不工作。我有一个带有 CentoOS 的虚拟机,在它上面我有一个在 http://localhost:8000 上运行的 django 应用程序,并且反向代理可以工作。
我复制应用程序的 .conf 文件以放置另一个 django 应用程序和 sonarqube。我创建了具有相同内容的 .conf 文件,只调整了应用程序名称及其目录。它只是不起作用!!!!:'(
我使用 docker-compose 放置了一个 sonarqube 服务器来运行。声纳服务器在 http://localhost:9000 运行。但是,当通过 URL http://myhost.com/sonar访问时,该站点无法打开,错误 404 Not Found。
- 它与docker-compose有关吗?
- 我的虚拟主机配置是否正确?
- 我在 VirtualHosts 中是否有任何配置冲突?
- 跟根目录有关系吗?
我在 sonar.conf 中的虚拟主机:
<VirtualHost *:80>
ServerName www.myhost.com
ServerAlias myhost.com
ServerAdmin admin@myhost.com
<Directory /var/www/html>
Require all granted
</Directory>
ProxyPass "/sonar" "http://localhost:9000"
ProxyPassReverse "/sonar" "http://localhost:9000"
<Location "/sonar">
order allow,deny
Allow from all
</Location>
</VirtualHost>
如果我输入日志信息,浏览器会显示日志目录:
ErrorLog /var/www/html/sonar/log/error.log
CustomLog /var/www/html/sonar/log/requests.log combined
解决方案
推荐阅读
- path - 如何更改 react-app-rewired 的构建路径
- python - 如何将 HTML 中的日期时间(作为 str)与 python 中的日期时间进行比较
- java - gitlab4j - 从 Java 创建提交到分支
- c# - 如何将 HiddenField 值解析为 DateTime
- jquery - 每个函数内的每个函数
- gitlab - 相当于 Gitahead 中的“新建目录”和“上传文件”
- css - 在网页中嵌入第一个外部图像
- wso2 - wso2 身份服务器 5.10.0 在设置 JDBC 用户存储时出现错误
- python - “工作表”对象没有属性“电子表格”
- sql - 使用 SQL Server 在连续行中检查行值