Rewrite domain and keep subdomain

Dridi Boukelmoune dridi at varni.sh
Tue Aug 25 15:58:09 CEST 2015


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