Forum Discussion
Satriaji
Mar 04, 2022Cirrus
Converting NGINX script to F5 iRules
Hii Everyone, Can i ask about converting NGINX script to iRules F5? I have a NGINX script : [root@webdplk conf.d]# cat simponi.conf server { listen 80; listen 443; server_name dplk.bni.co.id...
JRahm
Feb 28, 2023Admin
Something like this? (Assumes you don't need a virtual server listening on port 7005, but that the pool member you're forwarding traffic to is listening on that port and the virtual that is listening on 443 will translate)
when HTTP_REQUEST {
if { [HTTP::host] eq "dplk.bni.co.id" } {
switch -glob [HTTP::uri] {
"/" {
pool pool_192.168.3.187_80
HTTP::header insert X-Forwarded-Host [HTTP::host]
HTTP::header insert X-Forwarded-Server [HTTP::host]
HTTP::header insert X-Forwarded-Proto "https"
HTTP::header insert X-Forwarded-For [IP::client_addr]
}
"/mobile*" {
pool pool_192.168.3.186_7005
set uri [string map {"/mobile" ""} [HTTP::uri]]
}
default {
reject
}
}
}
}
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects