我在尝试设置代理传递并将一些代码写入页面顶部时遇到问题。
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错误,有任何想法吗?