mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #1203] host_header_rewrite doesn't support port rewrite #945
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#945
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 @bomblet2 on GitHub (Apr 19, 2019).
Original GitHub issue: https://github.com/fatedier/frp/issues/1203
I setup a frp server with subdomian_host frps.aaa.com
then I add some subdomains to my frp client.
[bcddphone]
type = http
local_port = 8085
subdomain = bcddphone
Everyting goes well when I request my url http://bcddphone.frps.aaa.com/aaa.aspx
But when my http server use redirect command 302 to redirect page.
The page may redirect to http://bcddphone.frps.aaa.com:8085/bbb.aspx
I've tried to add param
host_header_rewrite bcddphone.frps.aaa.com:80
But it doesn't work.
@bomblet2 commented on GitHub (Apr 20, 2019):
It seems ngrok can overwrite http header HOST with both host and port.
ngrok http -host-header=rewrite site.dev:80
----------- ngrok documents -----------
Rewriting the Host header
When forwarding to a local port, ngrok does not modify the tunneled HTTP requests at all, they are copied to your server byte-for-byte as they are received. Some application servers like WAMP, MAMP and pow use the Host header for determining which development site to display. For this reason, ngrok can rewrite your requests with a modified Host header. Use the -host-header switch to rewrite incoming HTTP requests.
If rewrite is specified, the Host header will be rewritten to match the hostname portion of the forwarding address. Any other value will cause the Host header to be rewritten to that value.
Rewrite the Host header to 'site.dev'
ngrok http -host-header=rewrite site.dev:80