nginx域名跳转问题

2025-03-24 13:15:32
推荐回答(1个)
回答1:

rewrite 的话 地址栏会变化的。如果要不变化,只能用proxy的方式。
location / {
root html/htdocs;
index index.html index.htm;
proxy_pass http://www.a.com/f.php
;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
请采纳。