Hi,
here's the scenario:
since nginx doesn't support forward proxy, I wanted to make it to handle forward proxy requests by using third party proxy server and some Nginx configuration. I make it out for GET and POST request, but for CONNECT request there was no chance.
I wanted to configure my Nginx web-server to recognize CONNECT request and bypass it to the proxy server. I used this config:
[code]
if ($request_method ~ ^CONNECT$ ) {
proxy_pass http://127.0.0.1:8080;
}
[/code]
but I always got 400 bad request error, I even tried just to change the error code and replace proxy_pass directive with "return 444" but nothing changes, the error occurs before nginx parse the configuration file.
here is my request and response headers:
[code]
CONNECT mail.google.com:443 HTTP/1.1
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Proxy-Connection: keep-alive
Host: mail.google.com
<html>
<head><title>400 Bad Request</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx/0.7.65</center>
</body>
</html>
[/code]
I would appreciate you reply and responses, and I hope someone may offer a solution for this problem, or a modification in nginx source code so I can make this scenario works.