gpt4 book ai didi

Docker-compose traefik PathPrefixStrip 无法正常工作

转载 作者:行者123 更新时间:2023-12-02 02:37:42 27 4
gpt4 key购买 nike

我有一个让我发疯的问题,请帮助我。

我想从一个免费的无 IP 子域访问我的所有应用程序,所以我认为 traefik 可以为我做到这一点,我想像这样访问我的所有应用程序:

 mysubdomain.no-ip.com/emby
mysubdomain.no-ip.com/pydio
mysubdomain.no-ip.com/adminer...

这是我的 docker 组成:

version: "2"
services:
db:
image: linuxserver/mariadb
restart: always
environment:
MYSQL_ROOT_PASSWORD: "test"
labels:
- "traefik.enable=false"
volumes:
- ./config/mariadb:/etc/mysql/
ports:
- '3306:3306'
adminer:
image: adminer
restart: always
labels:
- "traefik.enable=true"
- "traefik.backend=adminer"
- "traefik.frontend.rule=PathPrefixStrip:/dbadmin"
- "traefik.backend.port=8080"
volumes:
- ./config/adminer:/config
emby:
image: emby/embyserver:latest
restart: always
labels:
- "traefik.enable=true"
- "traefik.backend=emby"
- "traefik.frontend.rule=PathPrefixStrip:/media"
- "traefik.backend.port=8096"
volumes:
- ./config/emby:/config
cloud:
image: linuxserver/pydio:latest
restart: always
environment:
PGID: "1000"
PUID: "1000"
labels:
- "traefik.enable=true"
- "traefik.backend=cloud"
- "traefik.frontend.rule=PathPrefixStrip:/cloud"
- "traefik.backend.port=443"
- "traefik.protocol=https"
volumes:
- ./config/cloud:/config
- ./data/test:/data
organizr:
image: lsiocommunity/organizr
restart: always
environment:
PGID: "1000"
PUID: "1000"
TZ: "Europe/Paris"
labels:
- "traefik.enable=true"
- "traefik.backend=organizr"
- "traefik.frontend.rule=PathPrefixStrip:/"
- "traefik.backend.port=80"
volumes:
- ./config/organizr:/config
- ./data/organizr:/data
traefik:
image: traefik:1.3.3
command: --web --docker --docker.domain=traefik --logLevel=DEBUG #-c /dev/null --web --docker --logLevel=INFO
restart: always
ports:
- '80:80'
- '443:443'
- '8080:8080'
labels:
- "traefik.enable=false"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik.toml:/traefik.toml
- ./config/traefik/data:/data
- ./config/traefik/sslcerts:/ssl

我的traefik.toml

# defaultEntryPoints must be at the top because it should not be in any table below
defaultEntryPoints = ["http", "https"]
InsecureSkipVerify = true

[web]
# Port for the status page
address = ":8080"

# Entrypoints, http and https
[entryPoints]

# http should be redirected to https
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"

# https is the default
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[[entryPoints.https.tls.certificates]]
CertFile = "/ssl/tls.crt"
KeyFile = "/ssl/tls.key"
[retry]

# Enable ACME (Let's Encrypt): automatic SSL
# [acme]
# # caServer = "https://acme-staging.api.letsencrypt.org/directory"
# email = "test@gmail.com"
# storage = "acme.json" # or "traefik/acme/account" if using KV store
# entryPoint = "https"
# onDemand = false
# OnHostRule = true

[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "localhost"
watch = true
exposedbydefault = false

所以我只有 1 个功能强大的应用程序:emby。

管理员semms可以正常工作,加载css和其他 Assets ,但是当我提交表单时,它会将我发送到localhost/server=db&username=test,它应该将我发送到localhost/dbadmin/server=db&username=test

当我访问 localhost/cloud/时,如果我打开 Chrome 控制台,它会加载一个空白页面:

pydio.material.min.css Failed to load resource: the server responded with a status of 404 () pydio.boot.min.js Failed to load resource: the server responded with a status of 404 () 
cloud:18 Uncaught ReferenceError: PydioBootstrap is not defined at cloud:18 pydio.material.min.css Failed to load resource: the server responded with a status of 404 ()

事实上,它尝试从 localhost/plugins 加载插件,而不是从 localhost/cloud/plugins ...我在 github 上看到很多与此相关的问题,但似乎在 1.3.3 版本中得到了纠正,我尝试 1.3.3,最新...

pydio和adminer需要支持反向代理吗?

抱歉我的英语不好。

最佳答案

在 traefik 中,PathPrefixStrip 和入口点中的重定向 do not currently work together 。因此,如果您的请求转到 http 而不是 https,您将收到错误。

my own demo ,我只是在端口 80 上设置 nginx 来发送重定向作为短期解决方法,直到上述问题得到解决。

关于Docker-compose traefik PathPrefixStrip 无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47108424/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com