Rewrite domain and keep subdomain

Matt . yamakasi.014 at gmail.com
Tue Aug 25 16:39:54 CEST 2015


Hi Dridi,

Yes, I'm using Varnish already this way but I'm now about to "change"
the url in the adres bar first by using a 302 in some way to domain2.

What you decribe is what I already do but I need to redirect first.

Like

A6.audi.com -> A6.car.com
325.bmw.com -> 325.car.com

etc etc.

So writing this thread I need a 302 that way before I go furter in my VCL.

Thanks!

Matt

2015-08-25 15:58 GMT+02:00 Dridi Boukelmoune <dridi at varni.sh>:
> On Tue, Aug 25, 2015 at 2:55 PM, Matt . <yamakasi.014 at gmail.com> wrote:
>> Hi Dridi,
>>
>> Indeed, that works, I never tested that was as I test real code on dev machines.
>>
>> That works! but now it really rewrites, but the best would be to
>> redirect because of certificates that don't match.
>>
>> I would make sure domain one is accessed @ port 80, redirected to
>> domain2 at 443 as it has a valid certificate.
>>
>> That should be doable ?
>
> Yes, you can easily do that with Varnish, but you should get familiar
> with VCL and Varnish first.
>
> There are other considerations like making sure you don't generate an
> infinite loop of redirections etc.
>
>> Thanks!
>>
>> Matt
>>
>> 2015-08-25 10:42 GMT+02:00 Dridi Boukelmoune <dridi at varni.sh>:
>>> Hi Matt,
>>>
>>> I believe that's what my example does. It is a test case, you can run
>>> it with varnishtest.
>>>
>>> Attached is the same test case, with a second client requesting the
>>> other domain.
>>>
>>> Dridi
>>>
>>> On Mon, Aug 24, 2015 at 11:27 AM, Matt . <yamakasi.014 at gmail.com> wrote:
>>>> Hi Dridi,
>>>>
>>>> I'm not 100% sure about the example.
>>>>
>>>> The idea is that when I have
>>>>
>>>> domain1.tld
>>>> domain2.tld
>>>>
>>>> acceces with subdomainX.domain1.tld or subdomainY.domain2.tld or
>>>> whatever.domain1.tld I set it in my vcl to
>>>>
>>>> TheVisitedSubdomain.mymaindomain.tld
>>>>
>>>> And use that one in my VLC...
>>>>
>>>> Thanks so far!
>>>>
>>>> Matt



More information about the varnish-misc mailing list