Skip to content

Instantly share code, notes, and snippets.

@ed00m
Forked from dwallraff/f5_xfp.txt
Created October 6, 2017 00:31
Show Gist options
  • Save ed00m/6fe5dbb3cbc8ad39888cf2f412de040c to your computer and use it in GitHub Desktop.
Save ed00m/6fe5dbb3cbc8ad39888cf2f412de040c to your computer and use it in GitHub Desktop.

Revisions

  1. @dwallraff dwallraff renamed this gist Aug 17, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @dwallraff dwallraff created this gist Aug 17, 2016.
    17 changes: 17 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    Recommended solution would be:
    - Use Insert header, in the custom HTTP profile that you applied to the virtual servers.

    For HTTPS Virtuals, insert: X-Forwarded-Proto, with a value of https
    For HTTP Virtuals, insert: X-Forwarded-Proto, with a value of http

    Of course you could also use apply an iRule to the Virtual Server, something like this should work:

    when HTTP_REQUEST {
    if { [SSL::mode] == 1 } {
    if {!( [HTTP::header "X-Forwarded-Proto"] eq "https") }{
    HTTP::header insert X-Forwarded-Proto "https"
    }
    if { !( [HTTP::header exists "X-Forwarded-Port"]) }{
    HTTP::header insert X-Forwarded-Port [TCP::local_port]
    }
    }