I would like to access my frps subdomain using a letsencrypt ssl certificate, this is my docker-compose:
sudo vi docker-compose.yml
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--entrypoints.web.http.redirections.entryPoint.to=websecure"
- "--entrypoints.web.http.redirections.entryPoint.scheme=https"
- "--entrypoints.web.http.redirections.entryPoint.permanent=true"
- "--certificatesresolvers.myresolver.acme.httpchallenge=true"
- "--certificatesresolvers.myresolver.acme.httpchallenge.entrypoint=web"
# - "--certificatesresolvers.myresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
- "--certificatesresolvers.myresolver.acme.email=my@mail.com"
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- "./letsencrypt:/letsencrypt"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
frp:
labels:
- "traefik.enable=true"
- "traefik.http.routers.frp.rule=Host(`frps.mydomain.com`)"
- "traefik.http.routers.frp.entrypoints=websecure"
- "traefik.http.routers.frp.tls=true"
- "traefik.http.routers.frp.tls.certresolver=myresolver"
- "traefik.http.services.frp.loadbalancer.server.port=8081"
# - "traefik.tcp.routers.frp.rule=HostSNI(`frps.mydomain.com`)"
# - "traefik.tcp.routers.frp.entrypoints=web"
# - "traefik.tcp.routers.frp.certresolver=myresolver"
# - "traefik.tcp.routers.frp.tls=true"
# - "traefik.tcp.routers.frp.service=frpserver"
# - "traefik.tcp.services.frpserver.loadbalancer.server.port=8081"
image: cloverzrg/frps-docker
ports:
- "7000:7000"
- "7500:7500"
- "8081:8081"
network_mode: host
restart: always
command: -c /conf/frps.ini
volumes:
- ./frp:/conf
and my frps.ini
[common]
bind_port = 7000
token = aNolEYwREgOD
vhost_http_port = 8081
vhost_https_port = 8443dashboard_port = 7500
dashboard_user = admin
dashboard_pwd = admintcp_mux = true
max_pool_count = 10
it works without ssl when I add the port of the frp server but when I try to access https://frps.mydomain.com I can see the following error in traefiks logs:
time="2021-10-12T12:29:56Z" level=debug msg="'502 Bad Gateway' caused by: dial tcp 127.0.0.1:8081: connect: connection refused"