title: Is it possible to forward NON-http connecting request to some other port in nginx?
body: <p>I have nginx running on my server, listening port 80 and 433. I know nginx has a number ways of port forwarding that allows me to forward request like: <a href="http://myserver:80/subdir1" rel="noreferrer">http://myserver:80/subdir1</a> to some address like: <a href="http://myserver:8888" rel="noreferrer">http://myserver:8888</a>.</p>
  
  <p>My question is it possible to configure nginx so that i can forward <strong>NON</strong>-http request (just those <strong>plain TCP connection</strong>) to some other port? It's very easy to test if it's a http request because the first bytes will be either "GET" or "POST". Here's the example.</p>
  
  <p>The client connected to nginx .
  The client send:</p>
  
  <p>a. HTTP get request: "GET / HTTP 1.1": some rule for HTTP</p>
  
  <p>b. Any bytes that can't be recognized as HTTP header: forward it to some other port, say, 888, 999, etc.</p>
  
  <p>Is it technically possible? Or would you suggest a way to do this?</p>