NGINX:add_before_body抛出404错误

时间:2014-09-26 23:01:36

标签: php nginx http-status-code-404

我在尝试设置代理传递并将一些代码写入页面顶部时遇到问题。

server {
    listen       80;
    server_name  ns1.example.co.uk;
    location / {
        proxy_pass http://localhost/;
        proxy_set_header Accept-Encoding "";
    }

         location ~ \.php$ {
             root           html;
             fastcgi_pass   127.0.0.1:9000;
             fastcgi_index  index.php;
             fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
             include        fastcgi_params;
             add_before_body    myscripts/tobemirrored.php;
         }
}

它已成功添加到页面但是它出现了404错误,有任何想法吗?

0 个答案:

没有答案