Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

traefik部署访问失败 #59

Open
hehe9011 opened this issue Dec 16, 2023 · 2 comments
Open

traefik部署访问失败 #59

hehe9011 opened this issue Dec 16, 2023 · 2 comments

Comments

@hehe9011
Copy link

部署环境: Ubuntu 22.04.3 LTS

使用docker compose 部署:

version: '3.9'
services:
speedtest-x:
image: badapple9/speedtest-x
container_name: speedtest
restart: unless-stopped
tty: true
stdin_open: true
networks:
- traefik
ports:
- '9011:80'
labels:
traefik.enable: true
traefik.docker.network: traefik
traefik.http.routers.speedtest.rule: Host(speedtest.*.cn)
traefik.http.routers.speedtest.tls: true
traefik.http.routers.speedtest.tls.certresolver: myresolver
traefik.http.services.speedtest.loadbalancer.server.port: 9011

networks:
traefik:
external: true

无法访问,显示404 page not found, docker log如下:

  • cp /speedtest/speedtest.js /speedtest/speedtest_worker.js /var/www/html/
  • cp /speedtest/chart.html /speedtest/index.html /speedtest/results.html /var/www/html/
  • cp -r /speedtest/backend/ /var/www/html/backend
  • cp -r /speedtest/chartjs/ /var/www/html/chartjs
  • ln -snf /var/www/html/backend/speedlogs /speedlogs
  • chown -R www-data /var/www/html/backend /var/www/html/chart.html /var/www/html/chartjs /var/www/html/index.html /var/www/html/results.html /var/www/html/speedtest.js /var/www/html/speedtest_worker.js
  • '[' 80 '!=' 80 ']'
  • '[' 100 '!=' 100 ']'
  • '[' ip.sb '!=' ip.sb ']'
  • '[' false '!=' false ']'
  • echo 'Done, Starting APACHE'
    Done, Starting APACHE
  • apache2-foreground
    AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.26.0.7. Set the 'ServerName' directive globally to suppress this message
    AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.26.0.7. Set the 'ServerName' directive globally to suppress this message
    [Sat Dec 16 11:30:24.954697 2023] [mpm_prefork:notice] [pid 13] AH00163: Apache/2.4.54 (Debian) PHP/7.4.33 configured -- resuming normal operations
    [Sat Dec 16 11:30:24.954752 2023] [core:notice] [pid 13] AH00094: Command line: 'apache2 -D FOREGROUND'
@WPF0414
Copy link

WPF0414 commented Mar 20, 2024

兄弟,traefik.http.services.speedtest.loadbalancer.server.port是容器的端口,而不是宿主机。

@tankren
Copy link

tankren commented Oct 6, 2024

下面的是我的,正常使用

speedtest-x:
image: dockerproxy.net/badapple9/speedtest-x:latest
container_name: speedtest-x
environment:
  - SAME_IP_MULTI_LOGS=true
ports:
  - 9001:80
#network_mode: host
restart: unless-stopped
labels:
	- "traefik.enable=true"
	- "traefik.port=9001"
	- "traefik.http.routers.speedtest-x.rule=Host(`speedtest-x.domain.com`)"
	- "traefik.http.routers.speedtest-x.entrypoints=websecure"
	- "traefik.http.routers.speedtest-x.tls.certresolver=letsencrypt"
	- 'traefik.http.routers.speedtest-x.middlewares=authelia@docker'
networks:
  - "traefik_net"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants