简体   繁体   中英

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?

这个问题的答案是在Apache中配置虚拟主机时出错,我不得不注释掉我在那里错误地使用的ProxyRemote指令。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM