Mysterious HTTP 404 header in my own scripts

It turns out that it’s the require('../wp-blog-header.php'); part who caused the HTTP 404 error. I replaced the header code with:

status_header(200);
nocache_headers();

Both are part of WordPress API. And the problem went away. I found this solution from: http://wordpress.org/support/topic/integrating-wp-in-external-php-pages?replies=22