This iRule redirects HTTP requests to HTTPS on a specific IP address. When an HTTP request arrives, it checks if the request URI (Uniform Resource Identifier) starts with a '/'. If it does, it responds with a 302 redirect to the same URI but on the secure HTTPS protocol (https://192.168.31.10[HTTP::uri]).

when HTTP_REQUEST {
    if { [HTTP::uri] starts_with '/' } {
        HTTP::respond 302 Location 'https://192.168.31.10[HTTP::uri]'
    }
}

This iRule is useful for enforcing HTTPS access for a specific virtual server or application. You can customize the IP address and the redirection behavior to suit your needs.


原文地址: https://www.cveoy.top/t/topic/pKVw 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录