Forum Discussion

MSK_222682's avatar
MSK_222682
Icon for Nimbostratus rankNimbostratus
May 06, 2016
Solved

Maintenance page using iFiles

    Hi,

    I'm trying to setup a maintenance page using iFiles. I have gone through the below link and configured iFiles, iFiles List and created an irule as mentioned below,

    https://devcentral.f5.com/articles/v111-ndashexternal-file-access-from-irules-via-ifiles

    iRule:

    when HTTP_REQUEST { 
        if { [HTTP::uri] eq "/" } { 
            HTTP::respond 200 content [ifile get api_asia_html] 
        } else { discard } 
    }


    However, after attaching the above iRule I cannot access the virtual server as it gets timed out. Not sure if I'm missing something in my irule, which calls an html page with images already embedded.

Can anyone please verify my irule and let me know what I'm missing, so that anyone accessing this virtual server should see maintenance window page. 

Thanks in advance,
MSK
  • Hello,

     

    this irule serve api_asia_html content when the user reach / only. It will fail if you try to reach another uri or the same uri with query parameters. Also, can you check that you bind an HTTP profile, Client SSL profile (if https) to your Virtual Server and that the VS is reachable from the location of your testing ?

     

    You can also check the ltm logs to identify potentials issues or tcl errors.

     

10 Replies

  • Hello,

     

    this irule serve api_asia_html content when the user reach / only. It will fail if you try to reach another uri or the same uri with query parameters. Also, can you check that you bind an HTTP profile, Client SSL profile (if https) to your Virtual Server and that the VS is reachable from the location of your testing ?

     

    You can also check the ltm logs to identify potentials issues or tcl errors.

     

    • MSK_222682's avatar
      MSK_222682
      Icon for Nimbostratus rankNimbostratus
      Hi Yann, You were right, issue was this HTTP profile and Client SSL profile. I have uploaded cert now and applied HTTP profile and now its working good. However, this is working only for IE, but when tried from Chrome & Mozilla its not give me the page but the HTML embedded code. I feel I'm almost there as it works smooth in IE but not the other two. Do you have any idea on this. Thansk, MSK
    • Yann_Desmarest_'s avatar
      Yann_Desmarest_
      Icon for Nacreous rankNacreous
      Hi, your irule is not complete. Try to change the http::respond command by following : HTTP::respond 200 content [ifile get api_asia_html] noserver "Content-Type" "text/html" "Cache-Control" "no-cache, must-revalidate"
    • MSK_222682's avatar
      MSK_222682
      Icon for Nimbostratus rankNimbostratus
      Hi Yann, This works very smooth now. I have modified it and it works awesome. Thanks a ton. My URL is something like https://test.abc.com/Portal/. The maintenance page can be see when we access https://test.abc.com/Portal but when we add "/" after "Portal" it doesn't show anything, connection timeout. May I please know what exactly I'm missing because I already have this below condition : if { [HTTP::uri] eq "/" } { HTTP::respond 200 content [ifile get api_asia_html] which I believe would be triggered when uri is "/". Can you please correct my iRule ?? Br, MSK
  • Hello,

     

    this irule serve api_asia_html content when the user reach / only. It will fail if you try to reach another uri or the same uri with query parameters. Also, can you check that you bind an HTTP profile, Client SSL profile (if https) to your Virtual Server and that the VS is reachable from the location of your testing ?

     

    You can also check the ltm logs to identify potentials issues or tcl errors.

     

    • MSK_222682's avatar
      MSK_222682
      Icon for Nimbostratus rankNimbostratus
      Hi Yann, You were right, issue was this HTTP profile and Client SSL profile. I have uploaded cert now and applied HTTP profile and now its working good. However, this is working only for IE, but when tried from Chrome & Mozilla its not give me the page but the HTML embedded code. I feel I'm almost there as it works smooth in IE but not the other two. Do you have any idea on this. Thansk, MSK
    • Yann_Desmarest's avatar
      Yann_Desmarest
      Icon for Cirrus rankCirrus
      Hi, your irule is not complete. Try to change the http::respond command by following : HTTP::respond 200 content [ifile get api_asia_html] noserver "Content-Type" "text/html" "Cache-Control" "no-cache, must-revalidate"
    • MSK_222682's avatar
      MSK_222682
      Icon for Nimbostratus rankNimbostratus
      Hi Yann, This works very smooth now. I have modified it and it works awesome. Thanks a ton. My URL is something like https://test.abc.com/Portal/. The maintenance page can be see when we access https://test.abc.com/Portal but when we add "/" after "Portal" it doesn't show anything, connection timeout. May I please know what exactly I'm missing because I already have this below condition : if { [HTTP::uri] eq "/" } { HTTP::respond 200 content [ifile get api_asia_html] which I believe would be triggered when uri is "/". Can you please correct my iRule ?? Br, MSK