Forum Discussion
Replace or Remove Server tag from HTTP header
I'm trying to remove Server tag from HTTP Header. Actually, I'm using redirect for HTTP to HTTPS.
I applied the following irule:
when HTTP_REQUEST {
TCP::respond "HTTP/1.0 302 Found\r\nLocation: http://$site/site/index.seam\r\nConnection: close\r\nContent-Length: 0\r\n\r\n"
TCP::close
}
Afterwards, I did this test:
nc -vv xxx.xxx.xxx.xxx 80
Warning: forward host lookup failed for xxx.xxx.xxx.xxx.static.impsat.net.br: Unknown host : Connection timed out
xxx.xxx.xxx.xxx.static.impsat.net.br [xxx.xxx.xxx.xxx] 80 (www) open
HEAD / HTTP/1.0
HTTP/1.0 302 Found
Location: http://my.site.com/index.htm
Server: BigIP
Connection: close
Content-Length: 0
HTTP/1.0 302 Found
Location: http://my.site.com/index.htm
Connection: close
Content-Length: 0
The problem is: I can't remove Server tag, I just add another.
Could you help me?
Many thanks
4 Replies
- hoolio
Cirrostratus
Hi Billy,
If that was the exact TCP::respond command you used, it couldn't have had the Server: BigIP header from the iRule. Maybe you have another iRule you saw that with?
Regardless, on 9.4.2 and higher, you can use HTTP::respond with the noserver flag to suppress the Server: BigIP header:
from http://devcentral.f5.com/wiki/default.aspx/iRules/http__respond
HTTP::respond 302 noserver Location "https://[HTTP::host][HTTP::uri]"
Aaron - Billy_56049
Nimbostratus
Hey Aaron... Thank you so much for your support.
So... I'm using BigIP10.1.0... I tried to use HTTP::respond on "When HTTP_REQUEST" and I hadn't success.
The message is: Many redirect were found...
Do you have any idea my friend?
Thank you so much - hoolio
Cirrostratus
Hi Billy,
Can you post anonymized copies of the iRules you have enabled on this virtual server? You can use [ code ] [/ code ] blocks to post them here (without the spaces).
Aaron - Billy_56049
Nimbostratus
AAron... The problem is solved! :-)
I repleced all redirects for respond.
Example:
HTTP::redirect "http://$site/survey1/"
for
HTTP::respond 302 noserver Location "http://$site/survey1/"
Thank you so much for make things more clear!
Regards.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
