title: Block Nginx Requests if more than a certain number based on post request(XML)
body: <p>I have been trying to figure out how to block requests based on post xml request. For example below is the format of xml data we receive from a third party service from an integration, now the problem is that at times the third party service sends request pinging location of users almost like a ddos attack resulting in non responsiveness of the server. I don't want to block each every location ping request but only if the request count is too high and that too based on the xml data i.e, I would ideally want to detect only the location ping request coz all of the api post requests come through a single url and post data is dynamic based on the request.</p>
  
  <pre><code>      api.test.com/connect/wechat/XXXXXXXXX
  
        &lt;xml&gt;&lt;Event&gt;&lt;![CDATA[LOCATION]]&gt;&lt;/Event&gt;&lt;Latitude&gt;39.936901&lt;/Latitude&gt;&lt;Longitude&gt;116.410301&lt;/Longitude&gt;&lt;Precision&gt;30.000000&lt;/Precision&gt;&lt;/xml&gt;
  </code></pre>
  
  <p>I hope I am clear enough and any help would be highly appreciated. 
  Thanks in advance.</p>