Replies: 4 comments 3 replies
-
Can you reach containers on internal network?
Do you have an ssl cert?
If not, check permissions
…On Tue, May 23, 2023, 12:16 PM moltra ***@***.***> wrote:
I have followed your guide and trying to get traefik setup with docker. I
am getting 404 errors on every page I try to go to including the dashboard.
I replaced my domain name with example. Any and all help appreciated.
Docker-compose.yml
version: "3.9"
########################### NETWORKS
# You may customize the network subnet (192.168.90.0/24) below as you please.
# Docker Compose version 3.5 or higher required to define networks this way.
networks:
default:
driver: bridge
t2_proxy:
name: t2_proxy
driver: bridge
ipam:
config:
- subnet: 192.168.90.0/24
########################### EXTENSION FIELDS
# Helps eliminate repetition of sections
# More Info on how to use this: #228
# Common environment values
x-environment: &default-tz-puid-pgid
TZ: $TZ
PUID: $PUID
PGID: $PGID
# Keys common to some of the core services that we always to automatically restart on failure
x-common-keys-core: &common-keys-core
networks:
- t2_proxy
security_opt:
- no-new-privileges:true
restart: always
# Keys common to some of the dependent services/apps
x-common-keys-apps: &common-keys-apps
networks:
- t2_proxy
security_opt:
- no-new-privileges:true
restart: unless-stopped
# Keys common to some of the services in media-services.txt
x-common-keys-media: &common-keys-media
networks:
- t2_proxy
security_opt:
- no-new-privileges:true
restart: "no"
########################### SERVICES
services:
############################# FRONTENDS
# Traefik 2 - Reverse Proxy
traefik:
<<: *common-keys-core # See EXTENSION FIELDS at the top
container_name: traefik
image: traefik:2.7
command: # CLI arguments
- --global.checkNewVersion=true
- --global.sendAnonymousUsage=true
- --entryPoints.http.address=:80
- --entryPoints.https.address=:443
# Allow these IPs to set the X-Forwarded-* headers - Cloudflare IPs: https://www.cloudflare.com/ips/
- --entrypoints.https.forwardedHeaders.trustedIPs=$CLOUDFLARE_IPS,$LOCAL_IPS
- --entryPoints.traefik.address=:8080
- --api=true
# - --api.insecure=true
- --api.dashboard=true
# - --serversTransport.insecureSkipVerify=true
- --log=true
- --log.filePath=/logs/traefik.log
- --log.level=DEBUG # (Default: error) DEBUG, INFO, WARN, ERROR, FATAL, PANIC
- --accessLog=true
- --accessLog.filePath=/logs/access.log
- --accessLog.bufferingSize=100 # Configuring a buffer of 100 lines
- --accessLog.filters.statusCodes=204-299,400-499,500-599
- --providers.docker=true
- --providers.docker.endpoint=unix:///var/run/docker.sock # Use Docker Socket Proxy instead for improved security
# - --providers.docker.endpoint=tcp://socket-proxy:2375 # Use this instead of the previous line if you have socket proxy.
- --providers.docker.exposedByDefault=false
## Middlewares
- ***@***.***"
- ***@***.***
# Add dns-cloudflare as default certresolver for all services. Also enables TLS and no need to specify on individual services
- --entrypoints.https.http.tls.certresolver=dns-cloudflare
- --entrypoints.https.http.tls.domains[0].main=$DOMAINNAME_CLOUD_SERVER
- --entrypoints.https.http.tls.domains[0].sans=*.$DOMAINNAME_CLOUD_SERVER
# - --entrypoints.https.http.tls.domains[1].main=$DOMAINNAME2 # Pulls main cert for second domain
# - --entrypoints.https.http.tls.domains[1].sans=*.$DOMAINNAME2 # Pulls wildcard cert for second domain
- --providers.docker.network=t2_proxy
- --providers.docker.swarmMode=false
- --providers.file.directory=/rules # Load dynamic configuration from one or more .toml or .yml files in a directory
# - --providers.file.filename=/path/to/file # Load dynamic configuration from a file
- --providers.file.watch=true # Only works on top level files in the rules folder
- --certificatesResolvers.dns-cloudflare.acme.caServer=https://acme-staging-v02.api.letsencrypt.org/directory # LetsEncrypt Staging Server - uncomment when testing
- --certificatesResolvers.dns-cloudflare.acme.email=$CLOUDFLARE_EMAIL
- --certificatesResolvers.dns-cloudflare.acme.storage=/acme.json
- --certificatesResolvers.dns-cloudflare.acme.dnsChallenge.provider=cloudflare
- --certificatesResolvers.dns-cloudflare.acme.dnsChallenge.resolvers=1.1.1.1:53,1.0.0.1:53
- --certificatesResolvers.dns-cloudflare.acme.dnsChallenge.delayBeforeCheck=90 # To delay DNS check and reduce LE hitrate
networks:
t2_proxy:
ipv4_address: 192.168.90.254 # You can specify a static IP
# networks:
# - t2_proxy
ports:
- target: 80
published: 80
protocol: tcp
mode: host
- target: 443
published: 443
protocol: tcp
mode: host
# - target: 8080 # insecure api wont work
# published: 8080
# protocol: tcp
# mode: host
volumes:
- $DOCKERDIR/appdata/traefik2/rules/cloudserver:/rules # file provider directory
- /var/run/docker.sock:/var/run/docker.sock:ro # If you use Docker Socket Proxy, comment this line out
- $DOCKERDIR/appdata/traefik2/acme/acme.json:/acme.json # cert location - you must create this empty file and change permissions to 600
- $DOCKERDIR/logs/cloudserver/traefik:/logs # for fail2ban or crowdsec
- $DOCKERDIR/shared:/shared
environment:
- TZ=$TZ
- CF_API_EMAIL=$CLOUDFLARE_EMAIL
- CF_API_KEY=$CLOUDFLARE_API_KEY
- DOMAINNAME_CLOUD_SERVER # Passing the domain name to the traefik container to be able to use the variable in rules.
labels:
- "traefik.enable=true"
# HTTP-to-HTTPS Redirect
- "traefik.http.routers.http-catchall.entrypoints=http"
- "traefik.http.routers.http-catchall.rule=HostRegexp(`{host:.+}`)"
- "traefik.http.routers.http-catchall.middlewares=redirect-to-https"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
# HTTP Routers
- "traefik.http.routers.traefik-rtr.entrypoints=https"
- "traefik.http.routers.traefik-rtr.rule=Host(`traefik.$DOMAINNAME_CLOUD_SERVER`)"
- "traefik.http.routers.traefik-rtr.tls=true" # Some people had 404s without this
- "traefik.http.routers.traefik-rtr.tls.certresolver=dns-cloudflare" # Comment out this line after first run of traefik to force the use of wildcard certs
- "traefik.http.routers.traefik-rtr.tls.domains[0].main=$DOMAINNAME_CLOUD_SERVER"
- "traefik.http.routers.traefik-rtr.tls.domains[0].sans=*.$DOMAINNAME_CLOUD_SERVER"
# - "traefik.http.routers.traefik-rtr.tls.domains[1].main=$DOMAINNAME2" # Pulls main cert for second domain
# - "traefik.http.routers.traefik-rtr.tls.domains[1].sans=*.$DOMAINNAME2" # Pulls wildcard cert for second domain
## Services - API
- ***@***.***"
## Middlewares
- ***@***.***"
Access log.
000.33.198.139 - - [22/May/2023:18:53:23 +0000] "GET /dashboard/ HTTP/2.0" 404 19 "-" "-" 1 "-" "-" 0ms
000.14.134.170 - - [22/May/2023:18:54:17 +0000] "GET / HTTP/1.1" 404 19 "-" "-" 3 "-" "-" 0ms
traefik.log
time="2023-05-22T14:50:11-04:00" level=info msg="Traefik version 2.7.3 built on 2022-06-29T13:48:15Z"
time="2023-05-22T14:50:11-04:00" level=debug msg="Static configuration loaded {\"global\":{\"checkNewVersion\":true,\"sendAnonymousUsage\":true},\"serversTransport\":{\"maxIdleConnsPerHost\":200},\"entryPoints\":{\"http\":{\"address\":\":80\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":\"10s\"},\"respondingTimeouts\":{\"idleTimeout\":\"3m0s\"}},\"forwardedHeaders\":{},\"http\":{},\"udp\":{\"timeout\":\"3s\"}},\"https\":{\"address\":\":443\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":\"10s\"},\"respondingTimeouts\":{\"idleTimeout\":\"3m0s\"}},\"forwardedHeaders\":{\"trustedIPs\":[\"173.245.48.0/20\ <http://173.245.48.0/20%5C>",\"103.21.244.0/22\ <http://103.21.244.0/22%5C>",\"103.22.200.0/22\ <http://103.22.200.0/22%5C>",\"103.31.4.0/22\ <http://103.31.4.0/22%5C>",\"141.101.64.0/18\ <http://141.101.64.0/18%5C>",\"108.162.192.0/18\ <http://108.162.192.0/18%5C>",\"190.93.240.0/20\ <http://190.93.240.0/20%5C>",\"188.114.96.0/20\ <http://188.114.96.0/20%5C>",\"197.234.240.0/22\ <http://197.234.240.0/22%5C>",\"198.41.128.0/17\ <http://198.41.128.0/17%5C>",\"162.158.0.0/15\ <http://162.158.0.0/15%5C>",\"104.16.0.0/13\ <http://104.16.0.0/13%5C>",\"104.24.0.0/14\ <http://104.24.0.0/14%5C>",\"172.64.0.0/13\ <http://172.64.0.0/13%5C>",\"131.0.72.0/22\ <http://131.0.72.0/22%5C>",\"127.0.0.1/32\ <http://127.0.0.1/32%5C>",\"10.0.0.0/8\ <http://10.0.0.0/8%5C>",\"192.168.0.0/16\ <http://192.168.0.0/16%5C>",\"172.16.0.0/12\ <http://172.16.0.0/12%5C>"]},\"http\":{},\"udp\":{\"timeout\":\"3s\"}},\"traefik\":{\"address\":\":8080\",\"transport\":{\"lifeCycle\":{\"graceTimeOut\":\"10s\"},\"respondingTimeouts\":{\"idleTimeout\":\"3m0s\"}},\"forwardedHeaders\":{},\"http\":{},\"udp\":{\"timeout\":\"3s\"}}},\"providers\":{\"providersThrottleDuration\":\"2s\",\"docker\":{\"watch\":true,\"endpoint\":\"unix:///var/run/docker.sock\",\"defaultRule\":\"Host(`{{ normalize .Name }}`)\",\"swarmModeRefreshSeconds\":\"15s\"}},\"api\":{\"dashboard\":true},\"log\":{\"level\":\"DEBUG\",\"filePath\":\"/logs/traefik.log\",\"format\":\"common\"},\"accessLog\":{\"filePath\":\"/logs/access.log\",\"format\":\"common\",\"filters\":{\"statusCodes\":[\"204-299\",\"400-499\",\"500-599\"]},\"fields\":{\"defaultMode\":\"keep\",\"headers\":{\"defaultMode\":\"drop\"}},\"bufferingSize\":100},\"pilot\":{\"dashboard\":true}}"
time="2023-05-22T14:50:11-04:00" level=info msg="Stats collection is enabled."
time="2023-05-22T14:50:11-04:00" level=info msg="Many thanks for contributing to Traefik's improvement by allowing us to receive anonymous information from your configuration."
time="2023-05-22T14:50:11-04:00" level=info msg="Help us improve Traefik by leaving this feature on :)"
time="2023-05-22T14:50:11-04:00" level=info msg="More details on: https://doc.traefik.io/traefik/contributing/data-collection/"
time="2023-05-22T14:50:11-04:00" level=info msg="Starting provider aggregator aggregator.ProviderAggregator"
time="2023-05-22T14:50:11-04:00" level=debug msg="Starting TCP Server" entryPointName=http
time="2023-05-22T14:50:11-04:00" level=debug msg="Starting TCP Server" entryPointName=https
time="2023-05-22T14:50:11-04:00" level=debug msg="Starting TCP Server" entryPointName=traefik
time="2023-05-22T14:50:11-04:00" level=info msg="Starting provider *traefik.Provider"
time="2023-05-22T14:50:11-04:00" level=debug msg="*traefik.Provider provider configuration: {}"
time="2023-05-22T14:50:11-04:00" level=info msg="Starting provider *docker.Provider"
time="2023-05-22T14:50:11-04:00" level=debug msg="*docker.Provider provider configuration: {\"watch\":true,\"endpoint\":\"unix:///var/run/docker.sock\",\"defaultRule\":\"Host(`{{ normalize .Name }}`)\",\"swarmModeRefreshSeconds\":\"15s\"}"
time="2023-05-22T14:50:11-04:00" level=info msg="Starting provider *acme.ChallengeTLSALPN"
time="2023-05-22T14:50:11-04:00" level=debug msg="*acme.ChallengeTLSALPN provider configuration: {}"
time="2023-05-22T14:50:11-04:00" level=debug msg="Configuration received: {\"http\":{\"services\":{\"api\":{},\"dashboard\":{},\"noop\":{}},\"serversTransports\":{\"default\":{\"maxIdleConnsPerHost\":200}}},\"tcp\":{},\"udp\":{},\"tls\":{}}" providerName=internal
time="2023-05-22T14:50:11-04:00" level=debug msg="No default certificate, generating one" tlexmsStoreName=default
time="2023-05-22T14:50:11-04:00" level=debug msg="Provider connection established with docker 24.0.0 (API 1.43)" providerName=docker
time="2023-05-22T14:50:11-04:00" level=debug msg="Configuration received: ***@***.******@***.***\",\"rule\":\"Host(`traefik.example.cyou`)\",\"tls\":{\"certResolver\":\"dns-cloudflare\",\"domains\":[{\"main\":\"example.cyou\",\"sans\":[\"*.example.cyou\"]}]}}},\"services\":{\"traefik-docker\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://192.168.90.254:80\"}],\"passHostHeader\":true}}},\"middlewares\":{\"redirect-to-https\":{\"redirectScheme\":{\"scheme\":\"https\"}}}},\"tcp\":{},\"udp\":{}}" providerName=docker
time="2023-05-22T14:50:12-04:00" level=debug msg="No default certificate, generating one" tlsStoreName=default
time="2023-05-22T14:50:12-04:00" level=debug msg="Creating middleware" entryPointName=http middlewareType=Pipelining middlewareName=pipelining ***@***.*** serviceName=traefik-docker
time="2023-05-22T14:50:12-04:00" level=debug msg="Creating load-balancer" entryPointName=http ***@***.*** serviceName=traefik-docker
time="2023-05-22T14:50:12-04:00" level=debug msg="Creating server 0 http://192.168.90.254:80" ***@***.*** serviceName=traefik-docker serverName=0 entryPointName=http
time="2023-05-22T14:50:12-04:00" level=debug msg="child http://192.168.90.254:80 now UP"
time="2023-05-22T14:50:12-04:00" level=debug msg="Propagating new UP status"
time="2023-05-22T14:50:12-04:00" level=debug msg="Added outgoing tracing middleware traefik-docker" middlewareName=tracing middlewareType=TracingForwarder entryPointName=http ***@***.***
time="2023-05-22T14:50:12-04:00" level=debug msg="Creating middleware" middlewareType=RedirectScheme ***@***.*** entryPointName=http ***@***.***
time="2023-05-22T14:50:12-04:00" level=debug msg="Setting up redirection to https " middlewareType=RedirectScheme ***@***.*** entryPointName=http ***@***.***
time="2023-05-22T14:50:12-04:00" level=debug msg="Adding tracing to middleware" entryPointName=http ***@***.*** ***@***.***
time="2023-05-22T14:50:12-04:00" level=debug msg="Creating middleware" entryPointName=http middlewareType=Recovery middlewareName=traefik-internal-recovery
time="2023-05-22T14:50:12-04:00" level=debug msg="Added outgoing tracing middleware ***@***.***" entryPointName=https ***@***.*** middlewareName=tracing middlewareType=TracingForwarder
time="2023-05-22T14:50:12-04:00" level=error msg="middleware ***@***.***\" does not exist" ***@***.*** entryPointName=https
time="2023-05-22T14:50:12-04:00" level=debug msg="Creating middleware" entryPointName=https middlewareName=traefik-internal-recovery middlewareType=Recovery
time="2023-05-22T14:50:12-04:00" level=debug msg="Adding route for traefik.example.cyou with TLS options default" entryPointName=https
time="2023-05-22T14:50:12-04:00" level=error msg="the router ***@***.*** uses a non-existent resolver: dns-cloudflare"
time="2023-05-22T14:53:19-04:00" level=debug msg="Serving default certificate for request: \"traefik.example.cyou\""
time="2023-05-22T14:53:19-04:00" level=debug msg="http: TLS handshake error from 24.33.198.139:43860: remote error: tls: unknown certificate"
time="2023-05-22T14:53:23-04:00" level=debug msg="Serving default certificate for request: \"traefik.example.cyou\""
time="2023-05-22T14:53:23-04:00" level=debug msg="http: TLS handshake error from 24.33.198.139:59746: remote error: tls: unknown certificate"
time="2023-05-22T14:53:23-04:00" level=debug msg="Serving default certificate for request: \"traefik.example.cyou\""
time="2023-05-22T14:54:16-04:00" level=debug msg="Serving default certificate for request: \"\""
—
Reply to this email directly, view it on GitHub
<#313>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJIJNRBAQKYK736JUJAM62TXHTPGJANCNFSM6AAAAAAYMEGOL4>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Acme folder will be I'm appdata/traffic
Are you passing ports from docker network to Lan?
…On Tue, May 23, 2023, 3:37 PM moltra ***@***.***> wrote:
no, I am getting 404 errors on the computer also, Here is the permissions.
$ ls -alh
drwxrwxr-x+ 8 mark mark 4.0K May 20 00:17 .
drwxr-x--- 47 mark mark 4.0K May 19 23:51 ..
drwxrwxrwx+ 3 mark mark 4.0K May 20 00:13 appdata
drwxrwxrwx+ 2 mark mark 4.0K May 17 11:57 custom
-rw-rw-rw-+ 1 mark mark 6.9K May 22 14:00 docker-compose-t2.yml
-rw-rw-rw-+ 1 root root 559 May 19 23:57 .env
drwxrwxrwx+ 3 mark mark 4.0K May 20 00:16 logs
drwxrwxrwx+ 2 mark mark 4.0K May 17 11:57 scripts
drwxrwxrwx+ 2 mark mark 4.0K May 17 11:57 secrets
drwxrwxrwx+ 2 mark mark 4.0K May 19 23:42 shared
(base) ***@***.***:~/docker$
—
Reply to this email directly, view it on GitHub
<#313 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJIJNRCJWJL3TE3GMKS6JJ3XHUGXLANCNFSM6AAAAAAYMEGOL4>
.
You are receiving this because you commented.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
get access to a single container without traefik via Host IP:PORT.
Prefer Dozzle.
…On Wed, May 24, 2023 at 2:39 PM moltra ***@***.***> wrote:
My docker compose file was in the initial post. It shows what in San going
with my ports.
—
Reply to this email directly, view it on GitHub
<#313 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJIJNRHVEI6LGFW4K67IPQDXHZIUVANCNFSM6AAAAAAYMEGOL4>
.
You are receiving this because you commented.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
I had messed up the docker compose file |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have followed your guide and trying to get traefik setup with docker. I am getting 404 errors on every page I try to go to including the dashboard. I replaced my domain name with example. Any and all help appreciated.
Docker-compose.yml
Access log.
traefik.log
Beta Was this translation helpful? Give feedback.
All reactions