Rewriting request to to

Zev Blut zblut at
Mon Jan 31 13:53:58 MSK 2011


I am having a hard time getting the following type of domain rewrite to 
work.  This is what I have so far:

     server {
         listen       80;

         charset off;

         access_log  /var/log/nginx/iknow_access.log cerelog;
         location / {
            rewrite   ^ permanent;

         location /widgets/ {
            return 410;
         location /banners/ {
            return 410;

         error_page  404 410          /404.html;
         location = /404.html {
            root /data/foobar/current/public;

I want it to rewrite all requests to the to the flat 
level domain of

I.e. should be

But, I am getting instead.

Also, the 410 responses are redirecting just like the location /
This is with Nginx 0.7.65

Any ideas what I am doing wrong?


More information about the nginx mailing list