logan92
Dec 14, 2023Altocumulus
how to match hostname,uri & subdomain within stream profile
Hi,
I want to rewrite http contents in webpage based on certain subdomain xxx.yyyy.com , i want only to apply stream profile on this subdomain , the website has many domains like ccc.yyy.com , uuu.yyy.com , i want to convert some links in webpage from http to https. i've used this solution https://my.f5.com/manage/s/article/K31100432 , it works but it gives us errors in other webpages (other subdomains that exist on same website domain).
when HTTP_REQUEST {
# Disable the stream filter for all requests
STREAM::disable
# LTM does not decompress response content, so if the server has compression enabled
# and it cannot be disabled on the server, we can prevent the server from
# sending a compressed response by removing the compression offerings from the client
HTTP::header remove "Accept-Encoding"
}
when HTTP_RESPONSE {
# Check if response type is text
if {[HTTP::header value Content-Type] contains "text"}{
# Replace http:// with https://
STREAM::expression {@http://@https://@}
# Enable the stream filter for this response only
STREAM::enable
}
}
How can i match just for certain subdomain or host or uri in stream profile, as i know i need to change response contents from http to https but http response doesn't have URI.
i just need to apply this stream profile for just 1 subdomain exist on this https virtual server.