Stop users accessing website via IP address
Puneet
puneet.arora at insticator.com
Sun Jul 28 16:20:36 CEST 2013
Hi All,
Apologies for all this confusion and chaos.
I just don't want my website to be accessible by using the IP address on
which the website is hosted. Even if the Users use the IP address, I want
them to be redirected to my website.
It is the same way as www.facebook .com is hosted at "173.252.110.27".
When a user types "173.252.110.27" in the URL he is redirected to
"www.facebook.com"
I want to have the same functionality for mywebsite also.
To have this functionality I was trying Varnish to redirect the Users to
www.mywebsite.com .
Thanks
Puneet
-----Original Message-----
From: Poul-Henning Kamp [mailto:phk at phk.freebsd.dk]
Sent: Sunday, July 28, 2013 3:12 AM
To: Puneet
Cc: varnish-misc at varnish-cache.org
Subject: Re: Stop users accessing website via IP address
In message <000f01ce8b0a$a872c230$f9584690$@insticator.com>, Puneet writes:
>I want to stop the users accessing my website via IP address.
>I am using varnish as cache.
>I have the following code in place but it is not working.
>
>In vcl_recv() {
> if(req.url ~ "XX.XX.XXX.XXX") {
You should check the req.http.host header, that's where you will find the
IP# or hostname the user used.
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
More information about the varnish-misc
mailing list