Local Redirect Configuration

Hey,
I feel slightly embarrassed but I can't figure out how to redirect to a local port in my network (without docker containers).
First I was very new to apache, understood that, then tried NginX, works simmilarly but to me the traefik configuration is something else again :laughing:

I used this tutorial to install traefik:
https://goneuland.de/traefik-v2-reverse-proxy-fuer-docker-unter-debian-10-einrichten/

This is my traefik.yml:

api:
  dashboard: true
entryPoints:
  http:
    address: ":80"
  https:
    address: ":443"
providers:
  docker:
    endpoint: "unix:///var/run/docker.sock"
    exposedByDefault: false
  file:
    filename: "./dynamic_conf.yml"
certificatesResolvers:
  http:
    acme:
      email: securemail@gmail.com  ###
      storage: acme.json
      httpChallenge:
        entryPoint: http

This is my dynamic_conf.yml:
I think here I have to configure the redirect if I understood correctly and the commented part is my attempt of doing so. But sadly it didn't work.

tls:
  options:
    default:
      minVersion: VersionTLS12
      cipherSuites:
        - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
        - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
        - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305
        - TLS_AES_128_GCM_SHA256
        - TLS_AES_256_GCM_SHA384
        - TLS_CHACHA20_POLY1305_SHA256
      curvePreferences:
        - CurveP521
        - CurveP384
      sniStrict: true

# http routing section
http:
  middlewares:
    secHeaders:
      headers:
        browserXssFilter: true
        contentTypeNosniff: true
        frameDeny: true
        sslRedirect: true
        #HSTS Configuration
        stsIncludeSubdomains: true
        stsPreload: true
        stsSeconds: 31536000
        customFrameOptionsValue: "SAMEORIGIN"

  # # Define a connection between requests and services
  # # https://doc.traefik.io/traefik/routing/overview/
  # routers:
  #   to-fritzbox:
  #     rule: "Host('fritz.secureserver.de')"
  #     # # If the rule matches, applies the middleware
  #     # middlewares:
  #     # - secHeaders
  #     # If the rule matches, forward to the fritzbox service (declared below)
  #     service: fritzbox
  #   home-assistant:
  #     service: home-assistant
  #     rule: "Host(`assist.secureserver.de`)"
  #     entryPoints:
  #       - https
  #     tls:
  #       certResolver: http


  # services:
  #   # Define how to reach an existing service on our infrastructure
  #   fritzbox:
  #     loadBalancer:
  #       servers:
  #       - url: https://secureserver.myfritz.net:42790
  #   home-assistant:
  #     loadBalancer:
  #       servers:
  #         - url: http://192.168.178.94:8123

Any suggestions?

Managed to get it up and running with this dynamic_conf.yml

tls:
  options:
    default:
      minVersion: VersionTLS12
      cipherSuites:
        - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
        - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
        - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305
        - TLS_AES_128_GCM_SHA256
        - TLS_AES_256_GCM_SHA384
        - TLS_CHACHA20_POLY1305_SHA256
      curvePreferences:
        - CurveP521
        - CurveP384
      sniStrict: true

# http routing section
http:
  middlewares:
    secHeaders:
      headers:
        browserXssFilter: true
        contentTypeNosniff: true
        frameDeny: true
        sslRedirect: true
        #HSTS Configuration
        stsIncludeSubdomains: true
        stsPreload: true
        stsSeconds: 31536000
        customFrameOptionsValue: "SAMEORIGIN"


  # Define a connection between requests and services
  # https://doc.traefik.io/traefik/routing/overview/
  routers:
    to-fritzbox:
      rule: "Host(`fritz.secureserver.de`)"
      # If the rule matches, applies the middleware
      middlewares:
      - secHeaders
      # If the rule matches, forward to the fritzbox service (declared below)
      service: fritzbox
    
    to-https-fritzbox:
      rule: "Host(`fritz.secureserver.de`)"
      # If the rule matches, applies the middleware
      middlewares:
      - secHeaders
      # This is for https
      tls:
        options: default
        certResolver: "http"
      # If the rule matches, forward to the fritzbox service (declared below)
      service: fritzbox

  services:
    # Define how to reach an existing service on our infrastructure
    fritzbox:
      loadBalancer:
        servers:
        - url: "https://secureserver.myfritz.net:42790"

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