Rewrite domain and keep subdomain

Matt . yamakasi.014 at gmail.com
Mon Aug 24 21:45:06 CEST 2015


Hi,

Yes I found that too, wasn't sure about the expression.

Cheers,

Matt

2015-08-24 19:47 GMT+02:00 nick tailor <nick.tailor at gmail.com>:
> Okay,
>
> Well not sure what your googling? :)
>
> But this is what you want to do, hope that helps.
>
> https://www.varnish-software.com/book/3/build/exercises/complete-rewrite_urls_and_headers.html?highlight=redirect
>
> Cheers
>
> Nick Tailor
> nicktailor.com
>
> On Mon, Aug 24, 2015 at 10:40 AM, Matt . <yamakasi.014 at gmail.com> wrote:
>>
>> Hi,
>>
>> Nope I can't as Varnish does need to handle all.
>>
>> 2015-08-24 17:56 GMT+02:00 nick tailor <nick.tailor at gmail.com>:
>> > Couldn't you just use a rewrite rule in .htaccess? and then let varnish
>> > handle the actual domain you want served?
>> >
>> > Cheers
>> >
>> > Nick Tailor
>> > nicktailor.com
>> >
>> > On Mon, Aug 24, 2015 at 2: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
>> >>
>> >>
>> >>
>> >> 2015-08-24 9:59 GMT+02:00 Dridi Boukelmoune <dridi at varni.sh>:
>> >> > On Mon, Aug 24, 2015 at 1:41 AM, Matt . <yamakasi.014 at gmail.com>
>> >> > wrote:
>> >> >> Hi Guys,
>> >> >>
>> >> >> I'm figuring out how I can rewrite a domain in a req.http.Host
>> >> >>
>> >> >> Like I type in my  addressbar: subdomain.myFIRSTdomain.tld
>> >> >>
>> >> >> Where Varnish needs to catch this using req.http.Host filter out the
>> >> >> domainname and make req.http.Host actually:
>> >> >>
>> >> >> subdomain.mySECONDdomain.tld
>> >> >>
>> >> >> I'm figuring out how to do so, but I can't find the right way/docs.
>> >> >
>> >> > Hi Matt,
>> >> >
>> >> > This can be achieved with a regular expression, please find enclosed
>> >> > a
>> >> > test case demonstrating how to do that.
>> >> >
>> >> > Best Regards,
>> >> > Dridi
>> >> >
>> >> >> I hope someone can help me out !
>> >> >>
>> >> >> Thanks,
>> >> >>
>> >> >> Matt
>> >> >>
>> >> >> _______________________________________________
>> >> >> varnish-misc mailing list
>> >> >> varnish-misc at varnish-cache.org
>> >> >> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>> >>
>> >> _______________________________________________
>> >> varnish-misc mailing list
>> >> varnish-misc at varnish-cache.org
>> >> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>> >
>> >
>> >
>> >
>> > --
>> > Nick Tailor
>> >
>> > Senior Linux Systems Administrator
>> > BCLC, 2940 Virtual Way, Vancouver B.C. V5M 0A6
>> > T 604 228 3046  C 778 388 1397
>> >
>> > Connect with us:
>> > Twitter @BCLC| Twitter @BCLCGameSense | YouTube | Blog | bclc.com
>> >
>> >  Last year, more than $1 billion generated by BCLC gambling activities
>> > went
>> > back into health care, education and community groups across B.C.
>
>
>
>
> --
> Nick Tailor
>
> Senior Linux Systems Administrator
> BCLC, 2940 Virtual Way, Vancouver B.C. V5M 0A6
> T 604 228 3046  C 778 388 1397
>
> Connect with us:
> Twitter @BCLC| Twitter @BCLCGameSense | YouTube | Blog | bclc.com
>
>  Last year, more than $1 billion generated by BCLC gambling activities went
> back into health care, education and community groups across B.C.



More information about the varnish-misc mailing list