Forum Discussion
irule assistance on internal maintenance web page
I am an irule novice.
I have 2 irules that are identical except for the very first line.
One has :
if { ([HTTP::path] contains "/darwin") } {
and the other has
if { [active_members [LB::server pool]] < 1 } {
One is a conditional that checks the path for a certain character string and the other one checks to see if the pool is empty.
The one that checks for pool empty works just like it should.
It has some ifiles that have company logos and colors and formatting.
The one that checks the path for text sort of works and uses exactly the same ifiles but does not show the logos and formatting.
Any thoughts?
I am attaching the IRULES and a couple of screen shots of the different outcomes.
- Tom_KNimbostratus
This is not an answer - just trying to include the irule
- Tom_KNimbostratus
when HTTP_REQUEST { if { [active_members [LB::server pool]] < 1 } { log local0. "Original path: [HTTP::path]" log local0. "Original uri: [HTTP::uri]" log local0. "xxxxxxxxxxxx host: [HTTP::host]" switch [HTTP::uri] { "/styles.css" {HTTP::respond 200 content [ifile get "styles.css"]} "/bootstrap.min.css" {HTTP::respond 200 content [ifile get "bootstrap.min.css"]} "/bootstrap-accessibility.css" {HTTP::respond 200 content [ifile get "bootstrap-accessibility.css"]} "/umn-header.css" {HTTP::respond 200 content [ifile get "umn-header.css"]} "/umn-header-logo.png" {HTTP::respond 200 content [ifile get "umn-header-logo.png"]} "/umn-bootstrap-theme.css" {HTTP::respond 200 content [ifile get "umn-bootstrap-theme.css"]} "/fontawesome-all.min.js" {HTTP::respond 200 content [ifile get "fontawesome-all.min.js"]} default {HTTP::respond 200 content { <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="x-ua-compatible" content="ie=edge,chrome=1" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> <title>APAS Status</title> <link href="https://www1.umn.edu/twincities/favicon.ico" rel="shortcut icon" type="image/x-icon" /> <link href="/styles.css" rel="stylesheet" /> <link href="/bootstrap.min.css" rel="stylesheet" /> <link href="/bootstrap-accessibility.css" rel="stylesheet" /> <link href="/umn-header.css" rel="stylesheet" /> <link href="/umn-bootstrap-theme.css" rel="stylesheet" /> </head> <body> <header class="umn_header" aria-label="University of Minnesota"> <div class="container"> <a href="http://umn.edu/" class="umn_header-logo pull-left" >University of Minnesota website</a > <div class="umn_header-search pull-right hidden-xs"> <a href="https://www.myu.umn.edu/" >MyU <i class="fa fa-lock"></i>: For student, faculty, and staff</a > <form action="https://search.umn.edu/tc/" role="search" class="umn_header-search-form hidden-xs" > <input type="search" name="q" class="umn_header-search-input form-control" aria-label="Search terms" placeholder="Search UMN..." /> <button type="submit" class="umn_header-search-submit" aria-label="Search submit" > <i class="fa-search fa" aria-hidden="true"></i> </button> <input type="hidden" name="s" value="tc" /> <input type="hidden" name="u" value="1" /> </form> </div> </div> </header> <main role="main" style="padding-bottom: 148px;"> <div class="container"> <div class="row"> <div class="col-xs-12 text-center"> <!-- BEGIN: text for the DURING UPGRADE phase, legacy DARS-APAS is offline --> <h1 style="margin-bottom: 60px;"> APAS is offline </h1> <p class="lead" style="margin-bottom: 60px;"> The APAS application is currently offline while we perform a system upgrade. The application is scheduled to be available again on Sunday, June 30, 2019. </p> <!-- END: text for the DURING UPGRADE phase --> <!-- BEGIN: text for the AFTER UPGRADE phase, legacy DARS-APAS remains offline --> <!-- <h1 style="margin-bottom: 60px;"> A new APAS is available </h1> <p class="lead" style="margin-bottom: 60px;"> The APAS application was recently upgraded.<br /> You may access the application at its new address: <a href="https://apas.umn.edu" target="_blank">apas.umn.edu</a>. </p> --> <!-- END: text for the AFTER UPGRADE phase, legacy DARS-APAS remains offline --> <p class="text-muted"> For more information about this upgade, visit <a href="http://z.umn.edu/tada" target="_blank">z.umn.edu/tada</a>.<br /> </p> </div> </div> </div> </main> <script src="/fontawesome-all.min.js"></script> </body> </html> } } } } }
- Tom_KNimbostratus
- Tom_KNimbostratus
just trying to add the screen shot
- Tom_KNimbostratus
not an answer but more information -
when it does not work (checking for path contains "/darwin") from some log statements I see this in the log
Jun 21 10:47:20 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /Common/image-in-html-working-David-20190617.common <HTTP_REQUEST>: Original path: /darwin
Jun 21 10:47:20 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /Common/image-in-html-working-David-20190617.common <HTTP_REQUEST>: Original uri: /darwin
Jun 21 10:47:20 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /Common/image-in-html-working-David-20190617.common <HTTP_REQUEST>: xxxxxxxxxxxx host: lb-f5-vs1.oit.umn.edu
Jun 21 10:47:24 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /Common/image-in-html-working-David-20190617.common <HTTP_REQUEST>: Original path: /darwin
Jun 21 10:47:24 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /Common/image-in-html-working-David-20190617.common <HTTP_REQUEST>: Original uri: /darwin
Jun 21 10:47:24 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /Common/image-in-html-working-David-20190617.common <HTTP_REQUEST>: xxxxxxxxxxxx host: lb-f5-vs1.oit.umn.edu
Jun 21 10:47:24 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /Common/image-in-html-working-David-20190617.common <HTTP_REQUEST>: Original path: /darwin
Jun 21 10:47:24 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /Common/image-in-html-working-David-20190617.common <HTTP_REQUEST>: Original uri: /darwin
Jun 21 10:47:24 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /Common/image-in-html-working-David-20190617.common <HTTP_REQUEST>: xxxxxxxxxxxx host: lb-f5-vs1.oit.umn.edu
When it does work (< 1 in pool) I see this in the log:
Jun 21 10:36:18 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /part1/image-in-html-working-David-20190617 <HTTP_REQUEST>: Original path: /
Jun 21 10:36:18 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /part1/image-in-html-working-David-20190617 <HTTP_REQUEST>: Original uri: /
Jun 21 10:36:18 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /part1/image-in-html-working-David-20190617 <HTTP_REQUEST>: xxxxxxxxxxxx host: lb-f5-vs1.oit.umn.edu
Jun 21 10:36:18 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /part1/image-in-html-working-David-20190617 <HTTP_REQUEST>: Original path: /styles.css
Jun 21 10:36:18 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /part1/image-in-html-working-David-20190617 <HTTP_REQUEST>: Original uri: /styles.css
Jun 21 10:36:18 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /part1/image-in-html-working-David-20190617 <HTTP_REQUEST>: xxxxxxxxxxxx host: lb-f5-vs1.oit.umn.edu
Jun 21 10:36:18 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /part1/image-in-html-working-David-20190617 <HTTP_REQUEST>: Original path: /bootstrap-accessibility.css
Jun 21 10:36:18 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /part1/image-in-html-working-David-20190617 <HTTP_REQUEST>: Original uri: /bootstrap-accessibility.css
Jun 21 10:36:18 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /part1/image-in-html-working-David-20190617 <HTTP_REQUEST>: xxxxxxxxxxxx host: lb-f5-vs1.oit.umn.edu
Jun 21 10:36:18 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /part1/image-in-html-working-David-20190617 <HTTP_REQUEST>: Original path: /fontawesome-all.min.js
Jun 21 10:36:18 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /part1/image-in-html-working-David-20190617 <HTTP_REQUEST>: Original uri: /fontawesome-all.min.js
Jun 21 10:36:18 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /part1/image-in-html-working-David-20190617 <HTTP_REQUEST>: xxxxxxxxxxxx host: lb-f5-vs1.oit.umn.edu
Jun 21 10:36:18 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /part1/image-in-html-working-David-20190617 <HTTP_REQUEST>: Original path: /umn-bootstrap-theme.css
Jun 21 10:36:18 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /part1/image-in-html-working-David-20190617 <HTTP_REQUEST>: Original uri: /umn-bootstrap-theme.css
Jun 21 10:36:18 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /part1/image-in-html-working-David-20190617 <HTTP_REQUEST>: xxxxxxxxxxxx host: lb-f5-vs1.oit.umn.edu
Jun 21 10:36:18 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /part1/image-in-html-working-David-20190617 <HTTP_REQUEST>: Original path: /umn-header.css
Jun 21 10:36:18 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /part1/image-in-html-working-David-20190617 <HTTP_REQUEST>: Original uri: /umn-header.css
Jun 21 10:36:18 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /part1/image-in-html-working-David-20190617 <HTTP_REQUEST>: xxxxxxxxxxxx host: lb-f5-vs1.oit.umn.edu
Jun 21 10:36:18 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /part1/image-in-html-working-David-20190617 <HTTP_REQUEST>: Original path: /bootstrap.min.css
Jun 21 10:36:18 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /part1/image-in-html-working-David-20190617 <HTTP_REQUEST>: Original uri: /bootstrap.min.css
Jun 21 10:36:18 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /part1/image-in-html-working-David-20190617 <HTTP_REQUEST>: xxxxxxxxxxxx host: lb-f5-vs1.oit.umn.edu
Jun 21 10:36:18 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /part1/image-in-html-working-David-20190617 <HTTP_REQUEST>: Original path: /umn-header-logo.png
Jun 21 10:36:18 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /part1/image-in-html-working-David-20190617 <HTTP_REQUEST>: Original uri: /umn-header-logo.png
Jun 21 10:36:18 slot1/oit-lbw-ltmtest info tmm[11285]: Rule /part1/image-in-html-working-David-20190617 <HTTP_REQUEST>: xxxxxxxxxxxx host: lb-f5-vs1.oit.umn.edu
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