服务器问答
自己两个站,一个站想反代另一个站,但是有一个 PHP 文件使用本地 PHP 文件,这个如何处理呢?
部分 nginx 配置:
location /
{
proxy_pass https://abc.def.com;
proxy_redirect https://abc.def.com/ /;
proxy_set_header Host "abc.def.com";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto http;
proxy_set_header Accept-Encoding "";
proxy_set_header User-Agent $http_user_agent;
}
location /wp-content/themes/germaine-child/footer.php
国外服务器{
root /;
rewrite ^/wp-content/themes/germaine-child/footer.php$ /usr-path/wp-content/themes/germaine-child/footer.php break;
}
试着写了 rewrite,好像不生效,询问一下可行性方案,谢谢。