Forum Discussion
Jnon
Jan 03, 2018Nimbostratus
curl irule behavior
I have an irule that is as follows:
when HTTP_REQUEST {
set var1 [getfield [HTTP::uri] "/" 2 ]
log local0. "$var1"
HTTP::header replace "Host" "https://$var1.host.domain...
Jnon
Jan 03, 2018Nimbostratus
Sorry in the initial post I posted an incorrect curl command - that is corrected here along with additional improved formatting, and log details.
when HTTP_REQUEST {
set var1 [getfield [HTTP::uri] "/" 2 ]
log local0. "$var1"
HTTP::header replace "Host" "https://$var1.host.domain.com:9090"
log local0. "[HTTP::host]"
HTTP::uri [substr [HTTP::uri] [expr ([string length $var1 ] + 1 )]]
log local0. "Host and URI modified to: [HTTP::host][HTTP::uri]"
}
Sorry I don't have access to any of the server logs. I'll work on trying to get some of those though.
Curl Command:
$ curl -k -v -H 'Authorization:HCP certString ' https://host.domain.com:9090/var1/path1/path2/path3
output:
> GET /var1/path1/path2/path3 HTTP/1.1 ( would not expect to see var1 here )
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: host.domain.com:9090 ( would expect this to be var1.host.domain.com:9090 )
LTM log: ( this looks as it should )
: var1
: https://var1.host.domain.com:9090
: Host and URI modified to: https://var1.host.domain.com:9090/path1/path2/path3
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects