add header on custom error page

Sheng.Zheng sheng.zheng at etimestech.jp
Wed Sep 7 01:03:56 UTC 2011


Hi,
  i'm trying to add a 'X-ua-compatible' header on a custom 444 error
page  like below. but this  does not work. do you have any suggestions
on how to do this?

Any advise will be appreciated.

Thanks.



  error_page 444 = @err_444;

  location = /xxx {
      return 444;
  }

      location ~ \.php$ {
        try_files $uri =404;
        fastcgi_pass   unix:/var/run/php.sock;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        /etc/nginx/fastcgi_params;
    }


   location @err_444 {
        add_header  X-ua-compatible 'IE=EmulateIE8';
        rewrite ^ /index.php?url=err/444?;
    }




More information about the nginx mailing list