Project

General

Profile

Avoiding Chi.na Great Firewall

Added by yhzarcali over 14 years ago

Hello, I am running a website http://tvants.com, it is originally from China and it has been blocked some weeks ago by the chinese firewall. They only blocked http, so when you want to visit from china mainland you got something like " Connection reinitialized ", so I installed SSL, configured everything and it is working fine, but I need to redirect http://tvants.com to https://tvants.com, the normal redirections did not work.

$SERVER["socket"] == ":80" {
$HTTP["host"] =~ "(.*)" {
url.redirect = ( "^/(.*)" => "https://%1/$1" )
}
}

This worked one time I don't know why, but I had to refresh the page many times before it redirect successfuly and after I changed the config again it stoped working.
When a chinese connection try to get http://tvants.com even if the connection got reinitialized I got it from the log, it looks like so:

::ffff:116.76.255.122 www.tvants.com - [14/Aug/2009:10:14:24 +0200] "GET / HTTP/1.1" 200 54 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.2; fr; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2"
::ffff:116.76.255.122 www.tvants.com - [14/Aug/2009:10:17:02 +0200] "GET / HTTP/1.1" 200 54 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.2; fr; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2"
::ffff:116.76.255.122 www.tvants.com - [14/Aug/2009:10:18:48 +0200] "GET / HTTP/1.1" 200 54 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.2; fr; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2"
::ffff:116.76.255.122 www.tvants.com - [14/Aug/2009:10:24:10 +0200] "GET / HTTP/1.1" 200 54 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.2; fr; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2"
::ffff:116.76.255.122 tvants.com - [14/Aug/2009:10:25:54 +0200] "GET / HTTP/1.1" 301 0 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.2; fr; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2"
::ffff:116.76.255.122 www.tvants.com - [14/Aug/2009:10:28:14 +0200] "GET / HTTP/1.1" 301 0 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.2; fr; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2"

Oh yes, http://tvants.com is automatically redirected to http://www.tvants.com but only in china.

Thanks for the help.

/Cali