![](/img/trans.png)
[英]fopen() returns error: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
[英]Traefik returns error 404 on http requests
我有一個 traefik 反向代理實例在 linux 上的 docker 內運行。 我的問題是 traefik 總是在 http 請求上返回 404,但在 https 請求上卻沒有。 Https 請求工作正常,沒有任何問題。
這是我的 docker-compose.yml:
version: '3'
services:
ucp:
image: ghcr.io/rp-projekt/rp-server/ucp:main
volumes:
- /home/docker/ucp/.env:/usr/src/app/.env
networks:
- rp
restart: unless-stopped
extra_hosts:
- "docker.host.internal:host-gateway"
- "host.docker.internal:host-gateway"
labels:
- "traefik.enable=true"
- "traefik.http.middlewares.redir-https.redirectscheme.scheme=https"
- "traefik.http.middlewares.redir-https.redirectscheme.permanent=true"
- "traefik.http.routers.ucp.middlewares=redir-https@docker"
- "traefik.http.routers.ucp.tls.certresolver=le"
- "traefik.http.routers.ucp.rule=Host(`ucp.roestipommes.de`)"
- "traefik.http.routers.ucp.entrypoints=web,websecure"
- "traefik.http.services.ucp.loadbalancer.server.port=80"
- "traefik.http.routers.ucp.service=ucp"
networks:
rp:
external: true
我的 traefik 配置:
entryPoints:
web:
address: ":80"
forwardedHeaders:
trustedIPs:
- "127.0.0.1/32"
- "172.16.0.0/12"
- "10.0.0.0/8"
- "192.168.0.0/16"
websecure:
address: ":443"
forwardedHeaders:
trustedIPs:
- "127.0.0.1/32"
- "172.16.0.0/12"
- "10.0.0.0/8"
- "192.168.0.0/16"
providers:
file:
filename: /dynamic_config.yaml
docker:
exposedbydefault: False
certificatesResolvers:
le:
acme:
email: hidden
httpChallenge:
entryPoint: web
我通過為 http 和 https 創建兩個單獨的路由器解決了這個問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.