Skip to content

Commit

Permalink
Refactor ingress configuration to disable SSL redirect and force SSL …
Browse files Browse the repository at this point in the history
…backend protocol
  • Loading branch information
adamlahbib committed Nov 17, 2024
1 parent 754149c commit 264be3f
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions terraform/ingress.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@ resource "kubernetes_ingress_v1" "dev-ingress" {
namespace = "dev"
annotations = {
"nginx.ingress.kubernetes.io/rewrite-target" = "/"
"nginx.ingress.kubernetes.io/ssl-redirect" = "true"
"nginx.ingress.kubernetes.io/ssl-redirect" = "false"
"nginx.ingress.kubernetes.io/force-ssl-redirect" = "false"
"nginx.ingress.kubernetes.io/backend-protocol" = "HTTPS"
"nginx.ingress.kubernetes.io/configuration-snippet" = "if ($http_x_forwarded_proto = 'http') {return 301 https://$host$request_uri;}"
"openappsec.io/policy" = "open-appsec-best-practice-policy"
}
}

Expand Down Expand Up @@ -88,12 +86,9 @@ resource "kubernetes_ingress_v1" "prod-ingress" {
namespace = "prod"
annotations = {
"nginx.ingress.kubernetes.io/rewrite-target" = "/"
"nginx.ingress.kubernetes.io/ssl-redirect" = "true"
"nginx.ingress.kubernetes.io/ssl-redirect" = "false"
"nginx.ingress.kubernetes.io/force-ssl-redirect" = "false"
"nginx.ingress.kubernetes.io/backend-protocol" = "HTTPS"
"nginx.ingress.kubernetes.io/configuration-snippet" = "if ($http_x_forwarded_proto = 'http') {return 301 https://$host$request_uri;}"
"openappsec.io/policy" = "open-appsec-best-practice-policy"

}
}

Expand Down Expand Up @@ -134,11 +129,9 @@ resource "kubernetes_ingress_v1" "monitoring-ingress" {
namespace = "monitoring"
annotations = {
"nginx.ingress.kubernetes.io/rewrite-target" = "/"
"nginx.ingress.kubernetes.io/ssl-redirect" = "true"
"nginx.ingress.kubernetes.io/ssl-redirect" = "false"
"nginx.ingress.kubernetes.io/force-ssl-redirect" = "false"
"nginx.ingress.kubernetes.io/backend-protocol" = "HTTPS"
"nginx.ingress.kubernetes.io/configuration-snippet" = "if ($http_x_forwarded_proto = 'http') {return 301 https://$host$request_uri;}"
"openappsec.io/policy" = "open-appsec-best-practice-policy"
}
}

Expand Down

0 comments on commit 264be3f

Please sign in to comment.