我正在运行一个 phpMyAdmin 容器,我想通过 Apache 反向代理访问它。当我尝试访问它时,似乎网站本身正在加载,即页面标题显示“phpMyAdmin”,页面源代码显示正确的 HTML 内容。但是,由于所有资产链接都给出响应,因此页面看起来完全是空白的The requested URL was not found on this server.
。
我想知道为什么会发生这种情况。
我的docker-compose.yaml
:
version: '3.8'
services:
webserver:
container_name: webserver
image: php:8.2-apache
build:
context: ./webserver
dockerfile: Dockerfile
restart: unless-stopped
depends_on:
- db
volumes:
- ./public_html:/var/www/html
ports:
- 80:80
links:
- db
networks:
- app-network
db:
container_name: db
image: mariadb:lts
restart: unless-stopped
environment:
MYSQL_ROOT_HOST: '%'
MYSQL_ROOT_PASSWORD: abc123
volumes:
- db-data:/var/lib/mysql
networks:
- app-network
pma:
container_name: pma
image: phpmyadmin/phpmyadmin:latest
environment:
PMA_HOST: db
PMA_ABSOLUTE_URI: http://localhost/phpmyadmin/
depends_on:
- db
networks:
- app-network
volumes:
db-data:
networks:
app-network:
driver: bridge
我的网站配置conf
文件:
<VirtualHost *:80>
DocumentRoot "/var/www/html/"
<Location "/phpmyadmin">
ProxyPreserveHost On
ProxyPass "http://pma/"
ProxyPassReverse "http://pma/"
</Location>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
任何帮助都将不胜感激。非常感谢!