cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Bookmark
|
Subscribe
|
627
Views
5
Helpful
3
Replies

Using CSS to investigate Content Length value

per_2
Level 1
Level 1

I need to determine if I can examine the Content Length value in an HTTP header to prevent a web server from recieving invalid requests.

Here is the challenge:

I have an application out in the world that is submitting a blank XML document to one of my web services and it is causing the server to throw an exception. The exceptions are happening with enough frequency that the server is getting overwhelmed. I want to prevent these requests from reaching the server and I'm hoping that I can use CSS to identify the requests and send back an error (or send to another server to handle) when the METHOD=POST and Content Length = 0.

Is this possible?

1 Accepted Solution

Accepted Solutions

Hello Per,

I'm glad the information helped you out!

The following link explains the options when configuring header-field-rules on the CSS.

http://www.cisco.com/en/US/docs/app_ntwk_services/data_center_app_services/css11500series/v8.10/configuration/content_lb/guide/HHead.html

If you wish to truly understand the options in depth you can also read the HTTP RFC.

http://www.faqs.org/rfcs/rfc2616.html

I hope you have a great weekend as well!

- Jason

View solution in original post

3 Replies 3

jason.espino
Level 1
Level 1

Hello Per,

For this issue, it would be best to use a header-field-rule on the CSS. You can use something like the following to match/balance the inbound POST requests along with the content-length in the client's requests:

!********************* HEADER FIELD GROUP *********************

header-field-group Document

header-field http-method request-line contain "POST"

header-field content-length custom "Content-Length" contain "0"

With the above header-field-group configuration the CSS must match BOTH header-field-rules defined to properly balance the client's connections.

Please ensure the content rule you apply the above header-field-rule to has the following "url /*". This will force the CSS to see that rule as a layer 5/7 rule and properly inspect the URL and contents within the HTTP Header for the client's request.

Hope this info helps.

- Jason

per_2
Level 1
Level 1

Jason-

Thanks for your help, I really appreciate it!

Looking at the CSS Advanced Configuration Guide, I found guidance for HTTP Header Load Balancing using the syntax: header-field name field_type operator {header_string {search_length}}. With this format, neither command you suggested is listed as an option for "field_type" (http-method nor content-length). It certainly looks like it should work, though.

Would you have reference to any documentation that shows these options? There are likely more details there that I might learn from!

Thanks again Jason, I hope you have a fantastic week!

Hello Per,

I'm glad the information helped you out!

The following link explains the options when configuring header-field-rules on the CSS.

http://www.cisco.com/en/US/docs/app_ntwk_services/data_center_app_services/css11500series/v8.10/configuration/content_lb/guide/HHead.html

If you wish to truly understand the options in depth you can also read the HTTP RFC.

http://www.faqs.org/rfcs/rfc2616.html

I hope you have a great weekend as well!

- Jason

Review Cisco Networking for a $25 gift card