Redirecting with nginx

Today one of our server got in trouble with an ACE encoded IDN domain. The problem seemed to be rails in combination with nginx’s X-Sendfile feature. The result became that when accessing the site trough the IDN domain x-senfile did not send any files….

Our quick and dirty solution (until we have found the source/or solved the problem) became redirecting all traffic from the IDN domain to the domain without strange-swedish-characters.

With nginx this is as simple as in most webservers just put the following code before you original server configuration in nginx.conf.

server {
    rewrite ^(.*)$1 permanent;

And Bowang! All requests to www.svenskdomä will be redirected to

Domain names have been changed to protect the innocent :-)


Posted in Hosting, Rails at May 21st, 2008. Trackback URI: trackback Tags: , , Written by: 

It's past my bedtime is using WP-Gravatar