mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 16:15:49 -06:00
[GH-ISSUE #233] 请问 local_ip 和 host_header_rewrite 的关系是什么? #159
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#159
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @likev on GitHub (Jan 16, 2017).
Original GitHub issue: https://github.com/fatedier/frp/issues/233
比如下述配置:
是否需要将 dev.yourdomain.com 的 A 记录指向 192.168.0.6?还是说要像 test.yourdomain.com 一样指向服务器的 IP?
@fatedier commented on GitHub (Jan 16, 2017):
正常情况下是不需要使用这个参数的。
举个例子,比如你想通过 test.yourdomain.com 访问
www.baidu.com。 虽然这个请求被转发到了百度的服务器,但是你发送的 http 请求的 header 中的 host 参数是test.yourdomain.com,百度的后端服务可能会进行检测,如果 host 不是www.baidu.com就拒绝,返回相应错误。这个时候,如果你设置
host_header_rewrite = www.baidu.com,那么 frp 会将这个请求的 host 动态修改为www.baidu.com,百度的服务器看到的就是正常的请求,才能正常访问。如果你后端的 nginx 启用了虚拟主机这样的功能,需要根据 host 做路由,那么你才需要配置这个参数。