cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1422
Views
0
Helpful
6
Replies

ACE HTTP Header Port Rewrite

ericojijo
Level 1
Level 1

What is the syntax for rewriting the destination port for a HTTP request?

For Example: Rewriting "http://www.test123.com" TO "http://www.test123.com:81"

Thanks!

2 Accepted Solutions

Accepted Solutions

Jorge Bejarano
Level 4
Level 4

Hi,

Please check if you have configured any rewrite rule or NAT rule.

If possible attach the config and I will have a look.

regards,

Ajay Kumar

View solution in original post

6 Replies 6

ajayku2
Cisco Employee
Cisco Employee

Hi,

The simple solution is to specify port at rserver level to the desired port. In your case it should be like this :

host1/Admin(config-sfarm-host)# rserver SERVER1 81

this is from the documentation which explain the same:

Associating a Real Server with a Server Farm

You can associate one or more real servers with a server farm and enter real-server server-farm configuration mode by using the rserver command in either server farm host or server farm redirect  configuration mode. The real server must already exist. For information  about configuring a real server, see the "Configuring Real Servers" section. You can configure a maximum of 16,384 real servers in a server farm. The syntax of this command is as follows:

rserver name [port]

The arguments are as follows:

name—Unique  identifier of an existing real server. Enter an unquoted text string  with no spaces and a maximum of 64 alphanumeric characters.

port—(Optional) Port number used for the real server port address translation (PAT). Enter an integer from 1 to 65535.

If you choose not to assign a port number for the real server  association with the server farm, the default behavior by the ACE is to  automatically assign the same destination port that was used by the  inbound connection to the outbound server connection. For example, if  the incoming connection to the ACE is a secure client HTTPS connection,  the connection is typically made on port 443. If you do not assign a  port number to the real server, the ACE will automatically use port 443  to connect to the server, which results in the ACE making a clear-text  HTTP connection over port 443. In this case, you would typically define  an outbound destination port of 80, 81, or 8080 for the backend server  connection.

For example, to identify real server SERVER1 and specify port 80 for the outgoing connection, enter:

host1/Admin(config-sfarm-host)# rserver SERVER1 80

host1/Admin(config-sfarm-host-rs)#

Hope that helps.

regards,

Ajay Kumar

Thanks Ajay. The server farm hosts are already defined as you described above. The problem I'm having is that the client is attempting to connect to http://www.test123:81, but the ACE is stripping the port 81, and sennding it to the server on port 80. Any ideas?

Hi,

Please check if you have configured any rewrite rule or NAT rule.

If possible attach the config and I will have a look.

regards,

Ajay Kumar

Ajay,

There's no NAT rules configured, but I'll check the configs.

Jorge Bejarano
Level 4
Level 4

Eric,

Maybe you want to see the following:

https://supportforums.cisco.com/thread/2035408

Jorge

I finally resolved the use by creating a header rewrite action-list, and then applying it to the appropriate policy map:

action-list type modify http HEADER_REWRITE

     header rewrite request Host header-value "www.test123.com" replace "www.test123.com:81"

Thanks for your input,

Eric

Review Cisco Networking for a $25 gift card