Jump to content
Welcome to our new Citrix community!

Can I redirest a URL from one port to another?


Craig Gardner

Recommended Posts

Please bear with me on this... I am new to the Netscaler and to date have only done basic load balancing and URL redirection.
That being said, is it possible to take a URL and redirect it to a different port, say port 80 to port 81? If so, what are the steps I need to take?

Thank you for any assistance!!

Link to comment
Share on other sites

Hi Craig,

This is absolutely possible. In todays version of Netscaler you would create a Responder policy and action. The action will define the actual response that will go to the client, while the policy expression will define a boolean expression to define when to apply the action.

If I wanted to redirect http://www.citrix.com/ to http://www.citrix.com:81 I would use the following CLI configuration:

add responder action citrix_redir_action redirect "\"http://\" http.REQ.HOSTNAME.HTTP_URL_SAFE \":81\""
add responder policy citrix_redir_policy "http.REQ.HOSTNAME.EQ(\"www.citrix.com\") && client.TCP.DSTPORT.EQ(80)" citrix_redir_action

Keep in mind that this expression will be much easier to build using the expression builder in the GUI.

Thanks,

Jake Maynard
Senior Escalation Engineer
Netscaler Product Group

Link to comment
Share on other sites

  • 1 month later...

Craig,

Did you want to redirect the URL so that the NetScaler sends back the 302 redirect to the client, when then will issue a new GET for the correct port, or do you want the client to talk to the NetScaler on port 80, but the NetScaler to talk to the backend servers on port 81? That would be a different configuration, but still easy to do with the NetScaler.

Since the NetScaler is in between the client and the server systems, there are actually (in general) two different conversations taking place. In NetScaler terms, the client to NetScaler conversation goes to the Virtual IP (VIP) and the NetScaler to backend goes to the service (which is bound to a server). Since these are separate conversations, you can set up the VIP on port 80, protocol HTTP, and the backend service on port 81 (also HTTP). When the service gets bound to the VIP, the NetScaler knows to forward the requests to the VIP into requests to the bound services, and will change the port accordingly.

Link to comment
Share on other sites

  • 2 weeks later...

Just to add on to what Jacob said. You can use the following expression in case you want to keep the URL as well.

add responder action Test_action redirect "\"http://\"+http.REQ.HOSTNAME+\":81\"+http.REQ.url.HTTP_URL_SAFE" -bypassSafetyCheck YES

Edited by: Bejois Mathew on Jan 4, 2010 4:49 AM

Link to comment
Share on other sites

  • 10 years later...
On 11/5/2009 at 5:35 PM, Jacob Maynard said:

Hi Craig,

This is absolutely possible. In todays version of Netscaler you would create a Responder policy and action. The action will define the actual response that will go to the client, while the policy expression will define a boolean expression to define when to apply the action.

If I wanted to redirect http://www.citrix.com/ to http://www.citrix.com:81 I would use the following CLI configuration:

add responder action citrix_redir_action redirect "\"http://\" http.REQ.HOSTNAME.HTTP_URL_SAFE \":81\""
add responder policy citrix_redir_policy "http.REQ.HOSTNAME.EQ(\"www.citrix.com\") && client.TCP.DSTPORT.EQ(80)" citrix_redir_action

Keep in mind that this expression will be much easier to build using the expression builder in the GUI.

Thanks,

Jake Maynard
Senior Escalation Engineer
Netscaler Product Group

Where do I do this in the GUI? I tried your in the cli but got an error. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...