Добрый день, есть такая структура файлов
project-directory/
│
├── traefik/
│ └── acme.json
│ └── dynamic_conf.yml
│ └── traefik.yml
├── docker-compose.yml (Traefik)
при открытии proxy.web.ru можно наблюдать такую картину
нужно что бы при запросе wireguard.web.ru он открывал web морду по ip
194.67.000.000:51821
конфигурация файлов такая:
docker-compose.yml (Traefik)
version: '3.7'
traefik:
image: traefik:v2.5
container_name: traefik
restart: unless-stopped
ports:
- "80:80"
- "443:443"
- "51821:51821" # Предполагаемый порт для входных подключений Wireguard
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik/acme.json:/acme.json
- ./traefik/traefik.yml:/traefik.yml
- ./traefik/dynamic_conf.yml:/dynamic_conf.yml
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.web.http.redirections.entryPoint.to=websecure"
- "--entrypoints.web.http.redirections.entryPoint.scheme=https"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.myresolver.acme.tlschallenge=true"
- "--certificatesresolvers.myresolver.acme.email=sysadmin@web.ru"
- "--certificatesresolvers.myresolver.acme.storage=/acme.json"
- "--providers.file.filename=/dynamic_conf.yml"
labels:
- "traefik.enable=true"
- "traefik.http.routers.api.rule=Host(`proxy.web.ru`)"
- "traefik.http.routers.api.service=api@internal"
- "traefik.http.routers.api.entrypoints=websecure"
- "traefik.http.routers.api.tls.certresolver=myresolver"
networks:
default:
external:
name: web
dynamic_conf.yml
tcp:
routers:
wireguard-router:
rule: "HostSNI(`wireguard.web.ru`)"
entryPoints: ["wireguard"]
service: "wireguard-service"
services:
wireguard-service:
loadBalancer:
servers:
- address: "194.67.000.000:51821"
traefik.yml
global:
checkNewVersion: true
sendAnonymousUsage: false
api:
dashboard: true
log:
level: DEBUG
entryPoints:
web:
address: ":80"
http:
redirections:
entryPoint:
to: websecure
scheme: https
permanent: true
websecure:
address: ":443"
wireguard:
address: ":51821"
providers:
docker:
exposedByDefault: false
network: web
file:
filename: /dynamic_conf.yml
certificatesResolvers:
myresolver:
acme:
email: sysadmin@web.ru
storage: acme.json
httpChallenge:
entryPoint: web