需求
- 不暴露额外端口
- 使用80端口加子目录访问:http://your-public-ip-address/joplin/
- joplin以docker运行:joplin@docker
配置
traefik配置:joplin.yml
这里需要使用两个中间件来转发公网子目录的request,replacepathregex使用规则将对/joplin目录的请求改为对/根目录的请求
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
## Dynamic configuration http: routers: http-joplin: entryPoints: - "web" rule: "( PathPrefix(`/joplin`) )" service: "joplin@docker" middlewares: - joplin-replacepathregex middlewares: joplin-replacepathregex: replacePathRegex: regex: "^/joplin/(.*)" replacement: "/$1" |
joplin配置:.env