I have a very basic nginx setup that redirects www.example.com
to example.com
, following the best practice. It works, and in the Tor Firefox browser, going to http://www.idorecall.com/blog indeed updates the URL in the address bar to http://idorecall.com/blog.
But this doesn't change the URL in the address bar of Chrome, Firefox Portable, IE and Opera Portable.
Here's the modified default
nginx config. There are no other nginx config files other than nginx.conf.
server {
server_name www.idorecall.com;
return 301 $scheme://idorecall.com$request_uri;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name idorecall.com;
location / {
try_files $uri $uri/ =404;
}
location /blog {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header HOST $http_host;
proxy_pass http://127.0.0.1:2368;
}
}
wget -S
, http://www.rexswain.com/httpview.html, browsershots etc. correctly detect the 301 "Moved permanently" redirect. Most browsers though preserve the www URL. Super frustrating. Firefox and Opera were installed from scratch, so there's no history hit of the www domain.
GitHub manages to redirect http(s)://www.github.com to https://github.com in every browser. How do they do this?