Traefik nginx not able to use only HTTP

Hello Team,

I am trying to use http only for some testing, but I not able to make it to work. I am getting self signed Traefik certificate. I use Docker-compose for this.
Thank you in advance for your assistance.

version: '3.7'

services:
traefik:
# The latest official supported Traefik docker image
image: traefik:v2.5
# Enables the Traefik Dashboard and tells Traefik to listen to docker
# enable --log.level=INFO so we can see what Traefik is doing in the log files
ports:
# Exposes port 80 for incomming web requests
- "80:80"
- "443:443"
# The Web UI port http://0.0.0.0:8080 (enabled by --api.insecure=true)
- "8080:8080"
networks:
- brokenbyte-network
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock
- "./ssl:/etc/ssl"
- ./traefik.yml:/etc/traefik/traefik.yml
- ./letsencrypt:/letsencrypt

labels:
  - "traefik.enable=true"
  - "traefik.http.routers.traefik.rule=Host(`traefik.brokenbyte.dev`)"
  - "traefik.http.routers.traefik.entrypoints=web"
  - "traefik.http.routers.traefik.service=traefik"
  - "traefik.http.services.traefik.loadbalancer.server.port=8080"
  - "traefik.http.routers.traefik.tls.certresolver=myresolver"
  - "traefik.http.middlewares.traefik.redirectscheme.scheme=https"
  - "traefik.http.middlewares.traefik.redirectscheme.permanent=true"

web:
image: "nginx"

ports:

- "80:80"

- "443:443"

networks:
   - brokenbyte-network
restart: unless-stopped
volumes: 
  - "./config/:/etc/nginx/conf.d/"
  - "./app:/var/www/html/"
  - "./letsencrypt:/letsencrypt"

expose:

- "443"

- "80"

  - "traefik.http.routers.web.rule=Host(`ram.brokenbyte.dev`)"
  - "traefik.http.routers.web.entrypoints=web"
  - "traefik.http.routers.web.service=web"
  - "traefik.http.services.web.loadbalancer.server.port=80"
 - "traefik.http.routers.web.tls.certresolver=myresolver"
 - "traefik.http.middlewares.web.redirectscheme.scheme=http"
 - "traefik.http.middlewares.web.redirectscheme.permanent=true"

Not sure what you are trying to do here. Are you trying to get to the Traefik administration page or are you trying to publish a web page via Traefik?

Just a note, if you are trying to http on .dev, that subdomain is require https only. For more information on that .dev subdomain: Show your stuff with .dev – Google Domains

So if you are trying to access a .dev using only http, then it might not work.

Hello @webmastadj, I managed to configure requested behavior with nginx and certbot.
Anything, thank you for your assistance.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.