# 404 error using image pool iRule

**URL:** <https://community.f5.com/t/404-error-using-image-pool-irule/39333>\
**Category:** Technical Forums\
**Tags:** irules, dev, devops, application-delivery\
**Created:** [August 26, 2009, 9:21pm UTC](https://community.f5.com/t/404-error-using-image-pool-irule/39333 "2009-08-26T21:21:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pjcampbell\_7243](https://avatars.discourse-cdn.com/v4/letter/p/dfb087/32.png) [@pjcampbell\_7243](https://community.f5.com/u/pjcampbell_7243)\
**Post date:** [August 26, 2009, 9:21pm UTC](https://community.f5.com/t/404-error-using-image-pool-irule/39333/1 "2009-08-26T21:21:16Z")

</div>

We are intermittently getting an “404” error instead of a blank box or box with an X on it on our pages when using the following iRule

when HTTP\_REQUEST {

if { [HTTP::path] ends\_with “.jpg” }{

pool [images.xyz.com](http://images.xyz.com)

}

That is to say we will be surfing on some .jsp page, and a missing image will cause the user to be stopped dead on a 404 error, rather than the image simply not showing up within the .jsp page.

Any thoughts as to why this would happen?

---

<div class="post-metadata">

**Author:** ![hoolio](https://avatars.discourse-cdn.com/v4/letter/h/f6c823/32.png) [@hoolio](https://community.f5.com/u/hoolio)\
**Post date:** [August 26, 2009, 9:30pm UTC](https://community.f5.com/t/404-error-using-image-pool-irule/39333/2 "2009-08-26T21:30:49Z")

</div>

I’d guess the issue is that a request that should go to the default pool on the VIP is going to the image pool. You could explicitly add a default case to the iRule or add a OneConnect profile to the virtual server to prevent this.

```tcl
when CLIENT_ACCEPTED {  
     Save default pool name  
    set default_pool [LB::server pool]  
 }  
 when HTTP_REQUEST {  
    if { [HTTP::path] ends_with ".jpg" }{  
       pool images.xyz.com  
    } else { 
       pool $default_pool 
    } 
 }

```

For details on OneConnect and pool selection you can review Deb’s articles linked from this post:

[http://devcentral.f5.com/Default.aspx?tabid=53&view=topic&postid=30865&ptarget=30875](http://devcentral.f5.com/Default.aspx?tabid=53&view=topic&postid=30865&ptarget=30875)

and here:

[http://devcentral.f5.com/Default.aspx?tabid=53&forumid=5&tpage=1&view=topic&postid=3392157229](http://devcentral.f5.com/Default.aspx?tabid=53&forumid=5&tpage=1&view=topic&postid=3392157229)

Aaron

---

<div class="post-metadata">

**Author:** ![The\_Bhattman](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/the_bhattman/32/13958_2.png) [@The\_Bhattman](https://community.f5.com/u/The_Bhattman)\
**Post date:** [August 26, 2009, 9:38pm UTC](https://community.f5.com/t/404-error-using-image-pool-irule/39333/3 "2009-08-26T21:38:19Z")

</div>

Well the usual case is that that the request is going to a server in the pool that doesn’t contain the image.

Thanks,

Chetan

---

<div class="post-metadata">

**Author:** ![pjcampbell\_7243](https://avatars.discourse-cdn.com/v4/letter/p/dfb087/32.png) [@pjcampbell\_7243](https://community.f5.com/u/pjcampbell_7243)\
**Post date:** [September 1, 2009, 4:28pm UTC](https://community.f5.com/t/404-error-using-image-pool-irule/39333/4 "2009-09-01T16:28:15Z")

</div>

Thanks for the suggestions. I tried adding the default pool to the iRule, and we are still getting stray non .jpg files getting passed over to the image pool. We have OneConnect on the http virtual server, but not on the https virtual server. I can’t really confirm if the stray requests are coming from the http or https virtual (SSL offloaded to the BIG-IP). Should I try enabling oneconnect on the https virtual server?

---

<div class="post-metadata">

**Author:** ![hoolio](https://avatars.discourse-cdn.com/v4/letter/h/f6c823/32.png) [@hoolio](https://community.f5.com/u/hoolio)\
**Post date:** [September 1, 2009, 4:37pm UTC](https://community.f5.com/t/404-error-using-image-pool-irule/39333/5 "2009-09-01T16:37:43Z")

</div>

Can you add some debug to the iRule and try to reproduce the issue?

```tcl
when CLIENT_ACCEPTED {   
      Save default pool name 
     set default_pool [LB::server pool] 
  }   
  when HTTP_REQUEST {   
  
     log local0. "[IP::client_addr]:[TCP::client_port]: New HTTP request to [HTTP::host][HTTP::uri]" 
     if { [HTTP::path] ends_with ".jpg" }{   
        log local0. "[IP::client_addr]:[TCP::client_port]: Matched jpg check, using images.xyz.com pool" 
        pool images.xyz.com 
     } else {  
        log local0. "[IP::client_addr]:[TCP::client_port]: Using default pool" 
        pool $default_pool  
     }  
  }   
  when LB_SELECTED { 
     log local0. "[IP::client_addr]:[TCP::client_port]: Pool info: [LB::server]" 
  } 
  when SERVER_CONNECTED { 
     log local0. "[IP::client_addr]:[TCP::client_port]: Connection info: [IP::server_addr]:[TCP::server_port]" 
  }

```

Can you also post the VIP and profile configuration using ‘b virtual VIP\_NAME list’ and ‘b profile PROFILE\_NAME list’. Please anonymize the IP addresses and hostnames from the config and logs.

Thanks,

Aaron
