Mailing List Archive

#1812: Varnish 3.0.2 behind a SSL-Terminator
#1812: Varnish 3.0.2 behind a SSL-Terminator
-----------------------------------+--------------------
Reporter: nixmind | Type: defect
Status: new | Priority: high
Milestone: | Component: build
Version: 3.0.2 | Severity: normal
Keywords: redirect, http, https |
-----------------------------------+--------------------
Hi

Please do someone know if **varnish 3.0.2** support http redirection to
https.

In fact I have a varnish cache server behind a ssl terminator (an aws
external loadbalancer on which I set a **http** and a **https** listener).

I would like the varnish when it receives a http request, to redirect in
https, and directly send back the response (resquest?) to the
loadbalancer, and the loadbalancer will receive the response as a
**https** request and forward it the varnih which will then forward it to
its own backend.

But it seems like my varnish cache don't redirect back to the loadbalancer
but redirect the https request to its backend.

However the backend behind the varnish I don't have a https backend, I get
timemout when I issue a http request.
When the client enter https in the browser it works. The problem is with
http request.

Here is my configuration :

In **vcl_recv** :

if (client.ip != "127.0.0.1" && server.port == 80 && req.http.host ~
"^(?i)mydomain.com") {
set req.http.x-redir = "https://" + req.http.host + req.url;
#return(synth(850, "Moved permanently"));
error 850 "Moved permanently";
}
In **vcl_error** :

if (obj.status == 850) {
set obj.http.Location = req.http.x-redir;
set obj.status = 302;
return (deliver);
}

Can someone help please. I can't upgrade my varnish version manually at
the moment.

Thanks

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1812>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1812: Varnish 3.0.2 behind a SSL-Terminator [ In reply to ]
#1812: Varnish 3.0.2 behind a SSL-Terminator
-----------------------------------+--------------------
Reporter: nixmind | Owner:
Type: defect | Status: new
Priority: high | Milestone:
Component: build | Version: 3.0.2
Severity: normal | Resolution:
Keywords: redirect, http, https |
-----------------------------------+--------------------

Comment (by nixmind):

Update, I made a mistake in the proto check the code in the vcl_recv
should look like this :

{{{
if (client.ip != "127.0.0.1" && req.http.host ~ "^(?i)mydomain.com" &&
req.http.X-Forwarded-Proto !~ "(?i)https") {
set req.http.x-redir = "https://" + req.http.host + req.url;
#return(synth(850, "Moved permanently"));
error 850 "Moved permanently";
}
}}}

But it still don't work.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1812#comment:1>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1812: Varnish 3.0.2 behind a SSL-Terminator [ In reply to ]
#1812: Varnish 3.0.2 behind a SSL-Terminator
-----------------------------------+----------------------
Reporter: nixmind | Owner:
Type: defect | Status: closed
Priority: high | Milestone:
Component: build | Version: 3.0.2
Severity: normal | Resolution: invalid
Keywords: redirect, http, https |
-----------------------------------+----------------------
Changes (by fgsch):

* status: new => closed
* resolution: => invalid


Comment:

This system is for bug reporting.

For support please see https://www.varnish-cache.org/support.

Thanks.

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1812#comment:2>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs