title: Nginx catch "broken header" when listening to proxy_protocol
body: <p>I need to use http health checks on a Elastic Beanstalk application, with proxy protocol turned on. That is currently not possible, and the health check fails with a an error --> <code>*58 broken header while reading PROXY protocol</code></p>
  
  <p>I figured I have two options</p>
  
  <ol>
  <li>Perform the health check on another port, and setup nginx to listen to http requests on that port and proxy to my app.</li>
  <li>If it is possible to catch the <code>broken header</code> errors, or detect regular http requests in the <code>proxy_protocol</code> server block, then redirect those requests to a port that listens to http.</li>
  </ol>
  
  <p>I would prefer the latter(#2), if possible. So is there any way to do this?</p>
  
  <p>Ideally, I would prefer not to have to do any of this. A <a href="https://forums.aws.amazon.com/message.jspa?messageID=633016" rel="nofollow">feature request</a> to fix this has been submitted to AWS, but it has no ETA.</p>