Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner

images is not loading correctly

Jaspreetgurm
Altocumulus
Altocumulus

Images is not loading the page sitting behind F5 LTM

 

see error below.

0691T00000F65OZQAZ.png

 

Virtual server is setup with 2 pool memebers.

SSL offloading profile is setup on LTM

below irule also configured.

 

when HTTP_REQUEST {

 if { [string tolower [HTTP::uri]] starts_with "/gamification" } {

  HTTP::uri [string map -nocase {"/gamification" ""} [HTTP::uri]]

  }

}

 

 

can someone help on this.

7 REPLIES 7

crodriguez
Legacy Employee
Legacy Employee

Can you share the request and response headers on the request that fails so we have a little more to information for troubleshooting, please?

 

I have attached both screenshot below.

0691T00000F65ZwQAJ.png0691T00000F65ZhQAJ.png

xuwen
MVP
MVP

string map will replace all the string if it contains "/gamification", you need use regsub to replace first /gamification:

 

11 % set uri "/gamification/gamification_uploads/header.jpg"

/gamification/gamification_uploads/header.jpg

(bin) 12 % string map -nocase {"/gamification" ""} $uri

_uploads/header.jpg

(bin) 13 % set uri

/gamification/gamification_uploads/header.jpg

(bin) 14 % regsub -nocase "/gamification" $uri "" new_uri

1

(bin) 15 % set new_uri

/gamification_uploads/header.jpg

 

didn't worked... can you please explain more

You can simply tweak this part, so it matches your requirement.

when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/gamification" } {
HTTP::uri [string map -nocase {"/gamification/" "/"} [HTTP::uri]]
}
}

Explanation:

set newuri [string map -nocase {"/gamification" ""} $uri]

Will give you "_uploads/header.jpg"

But being specific like below,

set newuri [string map -nocase {"/gamification/" "/"} $uri]

Will give you "/gamification_uploads/header.jpg"

Hope it explains.

can you please brief more on this?

I tried the above suggestion and I got blank page.