Forum Discussion
101 connection reset
Hi all.
Firstly, i have to thank to all contributors in this forum, because they've saved my life a lot of times.
Today i have a problem with one irule.
I am writing an irule that concern this concepts:
First. If the destiny does not contain an explicit domain and uri is empty, you have to redirect the request to some place, whit the source host as uri,
Second: If it has an uri, i have to replace the host with an especific host leave the original uri without modification.
As i'm spanish and i'm not sure if i'm explained me correctly there it go an example.
1.- I the domain it is not www.ejemplo.com and the uri have not content.
Example:
http://www.noejemplo.com/ --> http://www.ejemplo.com/noejemplo.com
2.- If the request content and uri:
Example:
http://www.noejemplo.com/xyz --> http://www.ejemplo.com/xyz
In my irule, the second part run perfectly but the first option give me an error "101 error connection reset".
As you'll see below i've put the response in a log to trace it.
I do not know if you had found some error like this.
This is my Irule:
when HTTP_REQUEST {
set host_debug 1
set newhost "www.ejemplo.com"
set hostname [getfield [HTTP::host] ":" 1]
set suri [getfield [HTTP::host] ":" 1]
set ouri [HTTP::uri]
if { (not ([HTTP::host] equals $newhost)) and (not ([HTTP::uri] equals "/"))
}
{
HTTP::header replace Host $newhost
if {$host_debug}{log local0. "[HTTP::host]: First Case: Replaced Host header with $newhost$ouri"}
}
elseif { (not ([HTTP::host] equals $newhost))
}
{
HTTP::header replace Host $newhost/$suri
if {$host_debug}{log local0. "[HTTP::host]: Second case: Replaced Host header with $newhost/$suri."}
}
}
12 Replies
- Mohamed_Lrhazi
Altocumulus
What am i doing wrong?, why am i getting "101 connection reset" when i tried HTTP::header replace Host $newhost/$suri in the second case.
Like mentioned above... are you sure you want the HOST HEADER to contain $newhost/$suri ???? - Mohamed_Lrhazi
Altocumulus
set hostname [getfield [HTTP::host] ":" 1]
set suri [getfield [HTTP::host] ":" 1]
set ouri [HTTP::uri]
what does "suri" mean?
Recent Discussions
Related Content
* 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
