Hi,

In that config easies way is to check what is the source IP of incoming
connection, if it comes from 127.0.0.1 (or w/e. is ur stunnel server
address) its HTTPS else its HTTP. Like acl is_ssl src 127.0.0.1 and then
use it in redirect.

I did similiar thing, but with lighttpd as frontend and configured
lighttpd to add header "Ssl: Yes" (and remove any incoming headers named
Ssl, just in case ;)).

Dnia 2011-01-16, nie o godzinie 19:21 +0100, Henri Storn pisze:
> Hello,
> 
> I have a server hosting multiple Web sites. I use HAProxy, Stunnel and 
> HTTPD :
> 
> HTTP -> HAProxy (80) -> HTTPD (8080)
> HTTPS -> Stunnel (443) -> HAproxy (8443) -> HTTPD (8080)
> 
> I want a single Web site is accessible via HTTPS. The others are only 
> accessible by HTTP. I want to do the following redirects :
> - http://server.domain.com/ -> https://server.domain.com/ [OK]
> - https://other.domain.com/ -> https://other.domain.com/ [PROBLEM]
> 
> I can not create the ACL. Can you help me ?
> 
> listen http
>          bind *:80
>          acl url_admin hdr_beg server.domain.com
>          redirect prefix https://server.domain.com if url_admin
>          server srv 127.0.0.1:8080 maxconn 256
> 
> listen https
>          bind 192.168.0.100:8443
>          acl url_admin hdr_beg server.domain.com
>          redirect prefix http://XXXXX unless url_admin
>          option forwardfor except 192.168.0.100
>          server srv 127.0.0.1:8080 maxconn 256
> 
> 
> Thanks,
> 
> Regards.
> 


-- 
Mariusz Gronczewski (XANi) <[email protected]>
GnuPG: 0xEA8ACE64
http://devrandom.pl

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to