Skip to content

Commit

Permalink
Debugging Traefik rules
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewbaggett committed Dec 5, 2024
1 parent 3dfd4c0 commit 2ac4d17
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
24 changes: 12 additions & 12 deletions products/traefik/inputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,23 @@ variable "redirect_to_ssl" {
description = "Whether to redirect HTTP to HTTPS."
}
variable "http_port" {
type = number
default = 80
description = "The port to listen on for HTTP traffic."
type = number
default = 80
description = "The port to listen on for HTTP traffic."
}
variable "https_port" {
type = number
default = 443
description = "The port to listen on for HTTPS traffic."
type = number
default = 443
description = "The port to listen on for HTTPS traffic."
}
variable "dashboard_port" {
type = number
default = 8080
description = "The port to listen on for the dashboard."
type = number
default = 8080
description = "The port to listen on for the dashboard."
}

variable "ping_enable" {
type = bool
default = false
description = "Whether to enable the ping endpoint."
type = bool
default = false
description = "Whether to enable the ping endpoint."
}
10 changes: 6 additions & 4 deletions products/traefik/traefik.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ module "traefik" {
"--log.level=${var.log_level}",
"--accesslog=${var.access_log ? "true" : "false"}",
(var.ping_enable ? "--ping=true" : null),
(var.ping_enable ? "--ping.entrypoint=traefik,web,websecure" : null),
(var.ping_enable ? "--ping.entrypoint=web" : null),
(var.ping_enable ? "--ping.entrypoint=websecure" : null),
(var.ping_enable ? "--ping.entrypoint=traefik" : null),

# Confirm Docker Provider
"--providers.docker=true",
Expand All @@ -39,9 +41,9 @@ module "traefik" {

# Configure HTTPS
(var.https_port != null && var.ssl_enable ? "--entrypoints.websecure.address=:${var.https_port}" : null),
(var.https_port != null &&var.ssl_enable && var.redirect_to_ssl ? "--entrypoints.web.address=:${var.http_port}" : null),
(var.https_port != null &&var.ssl_enable && var.redirect_to_ssl ? "--entrypoints.web.http.redirections.entrypoint.to=websecure" : null),
(var.https_port != null &&var.ssl_enable && var.redirect_to_ssl ? "--entrypoints.web.http.redirections.entrypoint.scheme=https" : null),
(var.https_port != null && var.ssl_enable && var.redirect_to_ssl ? "--entrypoints.web.address=:${var.http_port}" : null),
(var.https_port != null && var.ssl_enable && var.redirect_to_ssl ? "--entrypoints.web.http.redirections.entrypoint.to=websecure" : null),
(var.https_port != null && var.ssl_enable && var.redirect_to_ssl ? "--entrypoints.web.http.redirections.entrypoint.scheme=https" : null),

# Configure the acme provider
(var.ssl_enable ? "--certificatesresolvers.default.acme.tlschallenge=true" : null),
Expand Down

0 comments on commit 2ac4d17

Please sign in to comment.