Website: 4s5.cn
Now, I would like to access the website at 123.4s5.cn using a reverse proxy.
My current plan is to use the PHP script from 4s5.cn to retrieve the domain name 123.4s5.cn!
After extensive research, I finally discovered that when configuring reverse proxy rules, you can simply set up a rule to forward requests for 123.4s5.cn!
location / {
proxy_pass http://4s5.cn;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# 将 123.4s5.cn 作为请求头信息传递给目标服务器
proxy_set_header X-Real-Domain "123.4s5.cn";
}Print directly in PHP即可看到你传递的值了!
$_SERVER