Necesito redirigir cada solicitud de http://test.com a http://www.test.com . ¿Cómo se puede hacer esto?
En el bloque del servidor intenté agregar
rewrite ^/(.*) http://www.test.com/$1 permanent;
pero en el navegador dice
The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for
this address in a way that will never complete.
mi bloque de servidor parece
server {
listen 80;
server_name test.com;
client_max_body_size 10M;
client_body_buffer_size 128k;
root /home/test/test/public;
passenger_enabled on;
rails_env production;
#rewrite ^/(.*) http://www.test.com/$1 permanent;
#rewrite ^(.*)$ $scheme://www.test.com$1;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}