Forum Discussion
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
16 Replies
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 } }- Mr_Ten_280720
Nimbostratus
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 ?
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.
- Yann_Desmarest_
Nacreous
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 } }- Mr_Ten_280720
Nimbostratus
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][ ]
- Yann_Desmarest_
Nacreous
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.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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