This article will demonstrate how to configure a Citrix Netscaler ssl redirect as well as how to configure a redirect from a port and rewrite action.
Netscaler SSL Redirect
This example will assume you already have a Virtual Server configured in your ADC VPX appliance and it’s listening on port 443. Rather than having an additional Virtual Server configured listening on port 80, you can leverage the Redirect From Port and HTTPS Redirect URL fields in the Basic Settings of the Virtual Server.
- Navigate to your Virtual Server. Configuration -> Traffic Management -> Load Balancing -> Virtual Servers
- Select the Virtual Server you are configuring the SSL redirect for.
- Click Edit on Basic Settings.
- Click More.
- In the Redirect From Port, enter 80 (or the non-ssl port your application is listening on).
- In the HTTPS Redirect URL, enter the FQDN of the application.
- Click Continue. That’s it. Test the configuration and save the running config if successful.
Netscaler Rewrite Action
On occasion you may have a requirement to rewrite or redirect a url based on a url path, host, etc. The Netscaler uses what is known as Responder Actions and Policies to perform such functionality. For example, if you are redirecting all traffic to a new url for a given Virtual Server, you can do this with Actions and Policies.
To create a Responder Action perform the following steps.
- Navigate to Configuration -> AppExpert -> Responder -> Actions
- Click Add
- Give the Action a Name, Type, and Expression.
- This example is for a simple redirect, so enter the url in quotations in the Expression text area.
- Enter the Response Status Code. For a redirect, it should be either a 301 (permanent) or 302 (temporary).
- Provide a Reason Phrase (optional)
- Provide any comments documenting the purpose of the Action.
- Click OK.
To create a Responder Policy perform the following steps.
- Navigate to Configuration -> AppExpert -> Responder -> Policies
- Click Add
- Give the Responder a Name, Action (select the Action created in the previous step), and Expression. Other fields are optional.
- In this example, the Expression should be http.REQ.HOSTNAME.EQ(“example.com”)
- Click OK.
To attach the policy to your Virtual Server perform the following steps.
- Navigate to Configuration -> Traffic Management -> Load Balancing -> Virtual Servers
- Select the Virtual Server to attach the policy to.
- Find policies and click Add Binding.
- Select the Policy created in the previous step.
- Click Bind
Make sure to save your running configuration.
This article has demonstrated how to configure a Citrix Netscaler to perform an SSL redirect from port 80 to port 443. Let us know in the comments if you have any questions. If this article was helpful, please read more of our content.