Skip to content

Commit

Permalink
AGW custom probes can set the host name to 127.0.0.1 by default
Browse files Browse the repository at this point in the history
"Picking" the host name from the backend pool means the "Host" header
that's sent to the backend is set to the IP of the instance itself,
which messes up our reverse-proxy redirection, etc.

e.g.:

`redirect_to /login` will redirect to 'https://10.1.1.1/login' instead
of 'https://my.url.com/login'
  • Loading branch information
steved committed Apr 10, 2019
1 parent cf688d1 commit 22b5fdd
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions resources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ resource "azurerm_application_gateway" "this" {
timeout = "${var.health_probe_timeout}"
unhealthy_threshold = "${var.health_probe_threshold}"
path = "${var.health_probe_path}"

pick_host_name_from_backend_http_settings = true
host = "127.0.0.1"
}

backend_http_settings {
Expand All @@ -85,8 +84,6 @@ resource "azurerm_application_gateway" "this" {
request_timeout = "${var.backend_request_timeout}"
probe_name = "${local.health_probe_name}"

pick_host_name_from_backend_address = true

connection_draining {
enabled = "${var.enable_connection_draining}"
drain_timeout_sec = "${var.connection_drain_timeout}"
Expand Down

0 comments on commit 22b5fdd

Please sign in to comment.