Jump to content
Welcome to our new Citrix community!

Content Switching Policy results in status sode 301 with Group Member Port exposed


Recommended Posts

Hey everyone,

 

I have an application server on my internal network, listening on HTTP Port 8000, and i want to redirect all request starting with "/api/v1" to this service.

 

I've created a Content Switching Virtual Server "mydomain" with protocol SSL.

My Content Switching Policy uses the following expression:

HTTP.REQ.URL.SET_TEXT_MODE(IGNORECASE).STARTSWITH("/api/v1")

The action is a Loadbalancing Virtual Server with Service Group for protocol HTTP and a Group Member Port 8000.

When i do a GET request on https://myserver/api/v1/ all works well and I receive the expected content with status code 200.
When i do a GET request on https://myserver/api/v1 I get the status code 301 with Location "http://myserver:8000/api/v1/".

 

Can someone explain to me why I get status code 301 here, and especially why port 8000 is visible?

 

Best regards, Martin

Link to comment
Share on other sites

Hello,

 

That's a configuration on your backend server which is redirecting you to that specific URL. In order to address your issue you could create a responder policy on the LB VSERVER that redirects as follows:

Policy: HTTP.REQ.URL.PATH.EQ("/api/v1")

Action: Redirect

"https://" + HTTP.REQ.HOSTNAME + "/api/v1/"

 

Hope it helps

  • Like 1
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...