Apache, mod_proxy and reverse proxying an IIS6 backend running .net 4
I have a really weird issue. I have an IIS6 backend server. If a site on IIS is configured to .net 2.0/3/3.5 then apache does a great job. If the site is configured to .net 4.0, apache serves up a 400 bad request. I've attached http headers and I can see the correct apache and correct iis server is hit, and the correct site on the iis server. If i go directly to the server it works great to in both modes. It's just the combination of apache (https) connecting to IIS6 (http) running a .net 4.0 site.
Here's some packet samples
Failing request
GET http://www.domain.com/ HTTP/1.1
Host: www.domain.com
Cache-Control: max-age=0
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.127 Safari/534.16
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Via: 1.1 domain.com
X-Forwarded-For: [ipaddress]
X-Forwarded-Host: www.domain.com
X-Forwarded-Server: domain.com
Connection: Keep-Alive
Failing response
HTTP/1.1 400 Bad Request
Connection: close
Date: Fri, 11 Mar 2011 02:24:34 GMT
Content-Type: text/html; charset=utf-8
Working Request
GET / HTTP/1.1
Host: www.domain.com
Cache-Control: max-age=0
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.127 Safari/534.16
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Connection: Keep-Alive
Working Response
HTTP/1.1 302 Found
Date: Fri, 11 Mar 2011 02:29:12 GMT
Location: /Account/Login/?ReturnUrl=%2f
Cache-Control: 开发者_开发问答private
Content-Type: text/html; charset=utf-8
Content-Length: 146
These two requests are for the same site, one via proxy one direct. The only thing I can see of any significance is the value for each get. One is a path and the other is a domain and path. But as I mentioned, all I have to do I switch the website in IIS6 to use the 2.0 runtime and not the 4.0 runtime.
Anyne got any ideas about what might be the problem?
The answer to this question was a mistake in the configuration of the virtualhost in apache I had to comment out the ProxyRemote directive that i had in there by mistake.
精彩评论