Issue reference local website

Helicon Ape provides support for Apache .htacces and .htpasswd configuration files for Microsoft IIS.
User avatar
Posts: 19
Joined: 03 May 2012, 19:19

Issue reference local website

08 May 2012, 19:46

We have IIS 7.5 wih several websites that have host headers specified in their bindings.

So on Website 1 I have this rule:

<Location /subdir1/>
ProxyPreserveHost On
ProxyPass http://other.website.com/subdir1/
ProxyPassReverse http://other.website.com/subdir1/
ProxyPassReverseCookieDomain other.website.com my.website.com
</Location>

other.website.com is in the local hosts file on the iis7.5 server and it's ip is bound to other.website.com.
Yet Ape will not proxy the request.

However, if I change the bindings to the ip address only (remove host header) and then use the rule below it works:

<Location /subdir1/>
ProxyPreserveHost On
ProxyPass http://xxx.xxx.xxx.xxx/subdir1/
ProxyPassReverse http://xxx.xxx.xxx.xxx/subdir1/
ProxyPassReverseCookieDomain xxx.xxx.xxx.xxx my.website.com
</Location>

I am positive the host entry is correct because I can browse to it on the local server. Any ideas why Ape will not resolve the local hosts entry?

- Alex

<Location /applysuny/>
ProxyPreserveHost On
ProxyPass http://141.254.104.171/applysuny/
ProxyPassReverse http://141.254.104.171/applysuny/
ProxyPassReverseCookieDomain 141.254.104.171 dev.suny.edu
</Location>

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: Issue reference local website

10 May 2012, 05:50

Hello,

First, please tell how your server resolves the host headers, maybe there's something not trivial.
Also, please enable logging by putting

LogLevel dedug

in httpd.conf and make request using host header and IP. Show the results in error.log.

Ans please specify what error message/status you get fir the host header request.

User avatar
Posts: 19
Joined: 03 May 2012, 19:19

Re: Issue reference local website

11 May 2012, 15:41

If I change the proxy to this it works:
<Location /applysuny/>
ProxyPreserveHost On
ProxyPass http://141.254.104.171/applysuny/
ProxyPassReverse http://141.254.104.171/applysuny/
ProxyPassReverseCookieDomain dev2.suny.edu dev.suny.edu
</Location>

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: Issue reference local website

14 May 2012, 05:55

Hello,

It seems that the Cookie string in response from back-end contains the host header value for "domain" parameter, not an IP.
Please make a request to the back-end via wFetch (Fiddler/FireBug) and show us what response you get.

User avatar
Posts: 19
Joined: 03 May 2012, 19:19

Re: Issue reference local website

14 May 2012, 08:43

ok I made this request:

http://other.website.com/applysuny

Response Header
Content-Encoding gzip
Content-Type text/html; charset=UTF-8
Date Mon, 14 May 2012 11:38:48 GMT
Server Microsoft-IIS/7.5
Transfer-Encoding chunked
Vary Accept-Encoding
X-Powered-By ASP.NET

Request Headersview source
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding gzip, deflate
Accept-Language en-us,en;q=0.5
Connection keep-alive
Cookie CFID=12104; CFTOKEN=4a75d68313d11257-EF6C63AC-5056-AD00-9D567ADEAF9D6AD5; JSESSIONID=44308669787bd58be7c11255810c7c3d4515
Host other.website.com
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0

It does look correct to me.
- Alex

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: Issue reference local website

15 May 2012, 06:12

Hello,

Thanks for the data but that's not exactly what we need.
You should make a request without Cookie header in it, then the response will contain "Set-Cookie domain" line, which we are interested in.

Please redo your request without Cookie header.

User avatar
Posts: 19
Joined: 03 May 2012, 19:19

Re: Issue reference local website

15 May 2012, 09:05

ok dumb question.. how do I make a request without the Cookie Header? I am no knowingly asking for it..
- Alex

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: Issue reference local website

16 May 2012, 06:25

Hello, Alex

You can either do it in wFetch or in Google Chrome open New incognito window, press Ctrl+Shift+I (to see the request/response headers), choose Network tab there, and make a request to the back-end.

User avatar
Posts: 19
Joined: 03 May 2012, 19:19

Re: Issue reference local website

16 May 2012, 09:28

OK not sure this is what was expected...

GET /applysuny/themes/sunytheme/jquery.ui.progressbar.css HTTP/1.1
Host: test2.suny.edu
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.168 Safari/535.19
Accept: text/css,*/*;q=0.1
Referer: http://test2.suny.edu/applysuny/
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
Cookie: CFID=201; CFTOKEN=1881589fe3f97ae4-5812A4E1-EA75-A036-ACEA9CD6A6011504; JSESSIONID=4430bb250a4ae2b174b1440175214ec59404

HTTP/1.1 200 OK
Content-Type: text/css
Last-Modified: Wed, 18 Jan 2012 20:34:18 GMT
Accept-Ranges: bytes
ETag: "6f351c8d20d6cc1:0"
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
Date: Wed, 16 May 2012 12:24:42 GMT
Connection: close
Content-Length: 4046


- Alex

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: Issue reference local website

18 May 2012, 07:51

This is still not what we need.
We need it to have Set-Cookie header which is not there...
What way did you choose to make a request without the cookie?

Return to Helicon Ape

Who is online

Users browsing this forum: No registered users and 36 guests