Re: http and https redirection

Khapare Joshi <[email protected]> Mon, 30 Jan 2012 14:42:28 +0000
Newsgroups gmane.linux.redhat.piranha
Message-ID <CABHhH+vjhrmqEvFDUAFBUGe2RKz6aQU7GQhGjXVDsSujPntAAQ@mail.gmail.com>
--===============2494484138061042111==
Content-Type: multipart/alternative; boundary=f46d040890f70ade0e04b7bfdbba

--f46d040890f70ade0e04b7bfdbba
Content-Type: text/plain; charset=ISO-8859-1

HI,

i think you are right. I noticed that Nanny is playing integral role in
lvs. I used the script like :

TEST=`/usr/bin/lynx -head -dump http://$1 2>/dev/null | grep -c "HTTP/1.1
301" `
if [ "$TEST" == "1" ]
        then
            echo "OK"
        else
            echo "FAIL"
fi

And this worked well for me. Thanks for your help

On Wed, Jan 25, 2012 at 10:04 AM, Andrey Feldman <[email protected]> wrote:

> Hi.
> Maybe nanny just can't understand HTTPS, so it expected something like
> "200 OK" from the host, but there is an SSL handshake.
> Try to use send_program in lvs.cf:
> send_program = "curl https://1.0.0.0"
> expect = "OK"
> Or something like this.
>
>
> On Tue, Jan 24, 2012 at 11:58 PM, Khapare Joshi <[email protected]>
> wrote:
> > Hello all,
> >
> > my load balancer seems now working and it does the fail over. I have now
> > issue with https. I added the VIP in piranha interface both for port 80
> and
> > 443 and added REAL server in these VIPs. I then opened port 80 and 443 on
> > active router (I am not sure if port 443 require to open as client
> actually
> > connects to port 80 ). Then I added VIP address on Real server and
> > configure apache to listen on port 443. I have a virtual section in REAL
> > server as below:
> >
> >
> > <VirtualHost 192.168.1.3:80>
> >         ServerName mytest
> >         DocumentRoot /var/www/html/test
> >         CustomLog /var/log/test_access_log combined
> >         AddDefaultCharset UTF-8
> >         Redirect Permanent / https://piranhatest.com/
> > </VirtualHost>
> >
> > <VirtualHost 192.168.1.1:443>
> >         ServerName piranhatest.com
> >         DocumentRoot /var/www/html
> >         AddDefaultCharset UTF-8
> > </VirtualHost>
> >
> > I have all the certtificate and required configuration in ssl.conf for
> 443.
> > But it does not work and complain that I do not have virtualhost for
> > 192.168.1.3:443. If i do not add this virtualhost for 192.168.1.3:443,
> > ipvsadm -L do not even list the real server of 443. 192.168.1.3 is my
> real
> > server and 192.168.1.1 is my VIP.
> >
> > How does Piranha handles this ? does the Real server eth0 and eth0:1 has
> to
> > be configured on port 443 ? or is there something in configuration I can
> do
> > so the lvs listen on port 80 and redirect to one of the Real server then
> > serve sties with RS VIP interface ? I am getting confused.
> >
> > All I am trying to now is I have a site obviously users connects with
> port
> > 80 but I would like to redirect to 443 /https port and I want to do this
> > with my piranha setup. Any hint would be appreciated.
> >
> > Khapare
> >
> > _______________________________________________
> > Piranha-list mailing list
> > [email protected]
> > https://www.redhat.com/mailman/listinfo/piranha-list
>
>
>
> --
> --
> Andrey Feldman
>
> _______________________________________________
> Piranha-list mailing list
> [email protected]
> https://www.redhat.com/mailman/listinfo/piranha-list
>

--f46d040890f70ade0e04b7bfdbba
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

HI,<br><br>i think you are right. I noticed that Nanny is playing integral =
role in lvs. I used the script like :<br><br>TEST=3D`/usr/bin/lynx -head -d=
ump http://$1 2&gt;/dev/null | grep -c &quot;HTTP/1.1 301&quot; `<br>if [ &=
quot;$TEST&quot; =3D=3D &quot;1&quot; ]<br>
=A0=A0=A0=A0=A0=A0=A0 then<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 echo &quot;=
OK&quot;<br>=A0=A0=A0=A0=A0=A0=A0 else<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
 echo &quot;FAIL&quot;<br>fi<br><br>And this worked well for me. Thanks for=
 your help<br><br><div class=3D"gmail_quote">On Wed, Jan 25, 2012 at 10:04 =
AM, Andrey Feldman <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]">pr1@=
pr1.ru</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">Hi.<br>
Maybe nanny just can&#39;t understand HTTPS, so it expected something like<=
br>
&quot;200 OK&quot; from the host, but there is an SSL handshake.<br>
Try to use send_program in <a href=3D"http://lvs.cf" target=3D"_blank">lvs.=
cf</a>:<br>
send_program =3D &quot;curl <a href=3D"https://1.0.0.0" target=3D"_blank">h=
ttps://1.0.0.0</a>&quot;<br>
expect =3D &quot;OK&quot;<br>
Or something like this.<br>
<div><div class=3D"h5"><br>
<br>
On Tue, Jan 24, 2012 at 11:58 PM, Khapare Joshi &lt;<a href=3D"mailto:khapa=
[email protected]">[email protected]</a>&gt; wrote:<br>
&gt; Hello all,<br>
&gt;<br>
&gt; my load balancer seems now working and it does the fail over. I have n=
ow<br>
&gt; issue with https. I added the VIP in piranha interface both for port 8=
0 and<br>
&gt; 443 and added REAL server in these VIPs. I then opened port 80 and 443=
 on<br>
&gt; active router (I am not sure if port 443 require to open as client act=
ually<br>
&gt; connects to port 80 ). Then I added VIP address on Real server and<br>
&gt; configure apache to listen on port 443. I have a virtual section in RE=
AL<br>
&gt; server as below:<br>
&gt;<br>
&gt;<br>
&gt; &lt;VirtualHost <a href=3D"http://192.168.1.3:80" target=3D"_blank">19=
2.168.1.3:80</a>&gt;<br>
&gt; =A0=A0=A0=A0=A0=A0=A0 ServerName mytest<br>
&gt; =A0=A0=A0=A0=A0=A0=A0 DocumentRoot /var/www/html/test<br>
&gt; =A0=A0=A0=A0=A0=A0=A0 CustomLog /var/log/test_access_log combined<br>
&gt; =A0=A0=A0=A0=A0=A0=A0 AddDefaultCharset UTF-8<br>
&gt; =A0=A0=A0=A0=A0=A0=A0 Redirect Permanent / <a href=3D"https://piranhat=
est.com/" target=3D"_blank">https://piranhatest.com/</a><br>
&gt; &lt;/VirtualHost&gt;<br>
&gt;<br>
&gt; &lt;VirtualHost <a href=3D"http://192.168.1.1:443" target=3D"_blank">1=
92.168.1.1:443</a>&gt;<br>
&gt; =A0=A0=A0=A0=A0=A0=A0 ServerName <a href=3D"http://piranhatest.com" ta=
rget=3D"_blank">piranhatest.com</a><br>
&gt; =A0=A0=A0=A0=A0=A0=A0 DocumentRoot /var/www/html<br>
&gt; =A0=A0=A0=A0=A0=A0=A0 AddDefaultCharset UTF-8<br>
&gt; &lt;/VirtualHost&gt;<br>
&gt;<br>
&gt; I have all the certtificate and required configuration in ssl.conf for=
 443.<br>
&gt; But it does not work and complain that I do not have virtualhost for<b=
r>
&gt; <a href=3D"http://192.168.1.3:443" target=3D"_blank">192.168.1.3:443</=
a>. If i do not add this virtualhost for <a href=3D"http://192.168.1.3:443"=
 target=3D"_blank">192.168.1.3:443</a>,<br>
&gt; ipvsadm -L do not even list the real server of 443. 192.168.1.3 is my =
real<br>
&gt; server and 192.168.1.1 is my VIP.<br>
&gt;<br>
&gt; How does Piranha handles this ? does the Real server eth0 and eth0:1 h=
as to<br>
&gt; be configured on port 443 ? or is there something in configuration I c=
an do<br>
&gt; so the lvs listen on port 80 and redirect to one of the Real server th=
en<br>
&gt; serve sties with RS VIP interface ? I am getting confused.<br>
&gt;<br>
&gt; All I am trying to now is I have a site obviously users connects with =
port<br>
&gt; 80 but I would like to redirect to 443 /https port and I want to do th=
is<br>
&gt; with my piranha setup. Any hint would be appreciated.<br>
&gt;<br>
&gt; Khapare<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Piranha-list mailing list<br>
&gt; <a href=3D"mailto:[email protected]">[email protected]</a>=
<br>
&gt; <a href=3D"https://www.redhat.com/mailman/listinfo/piranha-list" targe=
t=3D"_blank">https://www.redhat.com/mailman/listinfo/piranha-list</a><br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
<br>
<br>
--<br>
--<br>
Andrey Feldman<br>
<br>
_______________________________________________<br>
Piranha-list mailing list<br>
<a href=3D"mailto:[email protected]">[email protected]</a><br>
<a href=3D"https://www.redhat.com/mailman/listinfo/piranha-list" target=3D"=
_blank">https://www.redhat.com/mailman/listinfo/piranha-list</a><br>
</font></span></blockquote></div><br>

--f46d040890f70ade0e04b7bfdbba--


--===============2494484138061042111==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Piranha-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/piranha-list
--===============2494484138061042111==--