https 443 redirect to https 8443

Dear all, I have stuck with my irule redirect https standard to https 8443. I have configured: - VIP https 8443 (its working) - VIP https 443 to redirect 8443 with my irules “https2https” when HTTP_REQUEST { if {[string tolower [HTTP::uri]] starts_with “/efgh/abc/”}{ HTTP::redirect “https://abcd.com:8443/efgh/abc”} } - When I check tail -f /var/log/ltm like below Jul 22 15:01:50 slot1/F5ExtDC notice clusterd[7752]: 013a0006:5: mcpd tells us that config is being saved; incrementing this blade’s revision and saving cluster config Jul 22 15:11:15 slot1/F5ExtDC err mcpd[7748]: 01070151:3: Rule [/Common/https2https] error: /Common/https2https:2: error: [missing a script after “if”][]

Thks all

Hi,

the following irule should works for you :

when HTTP_REQUEST { 
    if { [string tolower [HTTP::uri]] starts_with "/efgh/abc/" } { 
        HTTP::respond 302 Location "https://abcd.com:8443/efgh/abc" Connection Close
    } 
}

Hi,

the following irule should works for you :

when HTTP_REQUEST { 
    if { [string tolower [HTTP::uri]] starts_with "/efgh/abc/" } { 
        HTTP::respond 302 Location "https://abcd.com:8443/efgh/abc" Connection Close
    } 
}

ITS NOT WORKING HIC HIC

Jul 22 16:36:20 slot1/F5ExtDC warning mcpd[7748]: 01071859:4: Warning generated : /Common/https2https:2: warning: [deprecated usage, use else or elseif][ ] Jul 22 16:36:20 slot1/F5ExtDC err mcpd[7748]: 01070151:3: Rule [/Common/https2https] error: /Common/https2https:2: error: [“unexpected end of argument sequence.”][log] /Common/https2https:2: error: [undefined procedure: local0.][local0.] /Common/https2https:2: error: [undefined procedure: test][if { [string tolower [HTTP::uri]] starts_with “/way4acs/enroll/” } log local0. “test” { HTTP::respond 302 Location “https://acbd.com:8443/efgh/abc/” Connection Close } ] Jul 22 16:36:35 slot1/F5ExtDC warning mcpd[7748]: 01071859:4: Warning generated : /Common/https2https:2: warning: [deprecated usage, use else or elseif][ ]

ITS NOT WORKING HIC HIC

Jul 22 16:36:20 slot1/F5ExtDC warning mcpd[7748]: 01071859:4: Warning generated : /Common/https2https:2: warning: [deprecated usage, use else or elseif][ ] Jul 22 16:36:20 slot1/F5ExtDC err mcpd[7748]: 01070151:3: Rule [/Common/https2https] error: /Common/https2https:2: error: [“unexpected end of argument sequence.”][log] /Common/https2https:2: error: [undefined procedure: local0.][local0.] /Common/https2https:2: error: [undefined procedure: test][if { [string tolower [HTTP::uri]] starts_with “/way4acs/enroll/” } log local0. “test” { HTTP::respond 302 Location “https://acbd.com:8443/efgh/abc/” Connection Close } ] Jul 22 16:36:35 slot1/F5ExtDC warning mcpd[7748]: 01071859:4: Warning generated : /Common/https2https:2: warning: [deprecated usage, use else or elseif][ ]

Can you post the complete irule because you get warnings and errors on different parts ?

Can you post the complete irule because you get warnings and errors on different parts ?

please use the 4th icon from the right (Preformated Code) to make your output more readable. and provide the full irule then because the output suggest you didn’t only copy paste what yann showed.

please use the 4th icon from the right (Preformated Code) to make your output more readable. and provide the full irule then because the output suggest you didn’t only copy paste what yann showed.

Hi all, When I do Yann Desmarest’s irule. Its not working , I’ve changed irule to log bug but its seem not working too. Pls check this rule to fix and log local. Thanks when HTTP_REQUEST {

if { [string tolower [HTTP::uri]] starts_with “/way4acs/enroll/” } {log local0. " This is the URI to redirect == [HTTP::uri]"} { HTTP::respond 302 Location “https://esecure.acb.com.vn:8443/way4acs/enroll/” Connection Close } } ++++++ Here is the log that I captured

Jul 25 08:58:23 slot1/F5ExtDC err mcpd[7748]: 01070151:3: Rule [/Common/https2https] error: /Common/https2https:2: error: [missing a script after “if”][ ] /Common/https2https:3: error: [undefined procedure: log local0. " This is the URI to redirect == [HTTP::uri]“][{log local0. " This is the URI to redirect == [HTTP::uri]”} {HTTP::respond 302 Location

Hi all, When I do Yann Desmarest’s irule. Its not working , I’ve changed irule to log bug but its seem not working too. Pls check this rule to fix and log local. Thanks when HTTP_REQUEST {

if { [string tolower [HTTP::uri]] starts_with “/way4acs/enroll/” } {log local0. " This is the URI to redirect == [HTTP::uri]"} { HTTP::respond 302 Location “https://esecure.acb.com.vn:8443/way4acs/enroll/” Connection Close } } ++++++ Here is the log that I captured

Jul 25 08:58:23 slot1/F5ExtDC err mcpd[7748]: 01070151:3: Rule [/Common/https2https] error: /Common/https2https:2: error: [missing a script after “if”][ ] /Common/https2https:3: error: [undefined procedure: log local0. " This is the URI to redirect == [HTTP::uri]“][{log local0. " This is the URI to redirect == [HTTP::uri]”} {HTTP::respond 302 Location

Unnecessary “}{” between log and respond: when HTTP_REQUEST { if { [string tolower [HTTP::uri]] starts_with “/way4acs/enroll/” } { log local0. " This is the URI to redirect == [HTTP::uri]" HTTP::respond 302 Location “https://esecure.acb.com.vn:8443/way4acs/enroll/” Connection Close }

}

Better

Unnecessary “}{” between log and respond: when HTTP_REQUEST { if { [string tolower [HTTP::uri]] starts_with “/way4acs/enroll/” } { log local0. " This is the URI to redirect == [HTTP::uri]" HTTP::respond 302 Location “https://esecure.acb.com.vn:8443/way4acs/enroll/” Connection Close }

}

Better

Hi all,

New log irule when I adjust my rule

Jul 25 11:19:19 slot1/F5ExtDC err mcpd[7748]: 01070151:3: Rule [/Common/https2https] error: /Common/https2https:1: error: [command is not valid in the current scope][if { [string tolower [HTTP::uri]] starts_with “/way4acs/enroll/” } { log local0. " This is the URI to redirect == [HTTP::uri]" HTTP::respond 302 Location “https://esecure.acb.com.vn:8443/way4acs/enroll/” Connection Close }] /Common/https2https:6: error: [command is not valid in the current scope][}]

Jul 25 11:38:11 slot1/F5ExtDC err mcpd[7748]: 01070151:3: Rule [/Common/https2https] error: /Common/https2https:2: error: [parse error: PARSE syntax 55 {syntax error in expression "[string tolower [HTTP::uri]] start_with “/way4acs/enroll” ": extra tokens at end of expression}][{[string tolower [HTTP::uri]] start_with “/way4acs/enroll” }]

Hi all,

New log irule when I adjust my rule

Jul 25 11:19:19 slot1/F5ExtDC err mcpd[7748]: 01070151:3: Rule [/Common/https2https] error: /Common/https2https:1: error: [command is not valid in the current scope][if { [string tolower [HTTP::uri]] starts_with “/way4acs/enroll/” } { log local0. " This is the URI to redirect == [HTTP::uri]" HTTP::respond 302 Location “https://esecure.acb.com.vn:8443/way4acs/enroll/” Connection Close }] /Common/https2https:6: error: [command is not valid in the current scope][}]

Jul 25 11:38:11 slot1/F5ExtDC err mcpd[7748]: 01070151:3: Rule [/Common/https2https] error: /Common/https2https:2: error: [parse error: PARSE syntax 55 {syntax error in expression "[string tolower [HTTP::uri]] start_with “/way4acs/enroll” ": extra tokens at end of expression}][{[string tolower [HTTP::uri]] start_with “/way4acs/enroll” }]

please use the 4th icon from the right (Preformated Code) to make your output more readable. and provide the full irule because the output suggest you didn’t only copy paste what yann and janholtz showed.

please use the 4th icon from the right (Preformated Code) to make your output more readable. and provide the full irule because the output suggest you didn’t only copy paste what yann and janholtz showed.