Web Application Firewall & Reverse Proxy

Expand all | Collapse all

Can ProxySG do the two-way URL rewrite with SSL reverse proxy?

  • 1.  Can ProxySG do the two-way URL rewrite with SSL reverse proxy?

    Posted 11-27-2018 05:13 AM

    I try to configure two-way URL rewrite with SSL reverse proxy.
     

    Cliets-----------<https>----------|ReverseProxy|------------|Server:81|

    So, exising all clients access to server by URL http://myapp.local:81/

    rightnow, they want to setup SSL reverse proxy for this application.

    I try to configure by two-way URL rewrite + SSL reverse proxy but not work,

    I design URL for all clients http://newmyapp.local and then Proxy will redirect(302) to https://newmyapp.local

    after client request to https://newmyapp.local I try to configure proxy rewirte to internal server by URL http://myapp.local:81

    but its not work.

    Anyonce have bester idea please advice?



  • 2.  RE: Can ProxySG do the two-way URL rewrite with SSL reverse proxy?

    Broadcom Employee
    Posted 11-28-2018 06:30 AM

    Hi Pongsaphat,

     

                   This should work fine. Try to test the TWURL first before you introduce the http to https redirect. Below you can find a policy I have created for your specific need. Try adding the same in a seperate CPL layer and test the access.

     

    <proxy>
    	url.domain=https://newmyapp.local  action.App_portal(yes)
    
    <cache>
    	action.ForceUncompressedResponse(yes)
    
    define action ForceUncompressedResponse
    	delete(request.header.Accept-Encoding)
    end action ForceUncompressedResponse
    
    define url_rewrite App_rewrite
      	rewrite_url_prefix  "https://newmyapp.local" "http://myapp.local:81"
    	rewrite_url_substring "https://newmyapp.local" "http://myapp.local:81"
    	rewrite_script_substring "https://newmyapp.local" "http://myapp.local:81"
    end
    
    
    define action App_portal
    	rewrite(url,"https://newmyapp.local/(.*)","http://myapp.local:81/$(1)")
    	rewrite(request.header.Referer, "https://newmyapp.local/(.*)", "http://myapp.local:81/$(1)")
    	rewrite(response.header.Location,"http://myapp.local:81/(.*)", "https://newmyapp.local/$(1)")
    	rewrite(response.header.Content-Location,"http://myapp.local:81/(.*)", "https://newmyapp.local/$(1)")
    	transform App_rewrite
    end