mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #3216] redirect by location in responseheader #2581
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#2581
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 @cedricbieder on GitHub (Dec 17, 2022).
Original GitHub issue: https://github.com/fatedier/frp/issues/3216
Bug Description
Hello, I am getting an annoying bevahior by one of my client targets.
I want to tunnel a https page:
The page is running on port 82, by my frpc and frps .ini I forward that page to subdomain.mydomain:8082.
I get the login in page of the targt. But after I login the page always jump to subdomain.mydomain:82.
I could observe that before that redirect I get a location: subdomain.mydomain:82. in the response header by the page.
I tried something like host_header_rewrite, but that seems to have no impact at all.
So my question. Is there an opportunity I can block this redirect? or I can change the response header (on frpc or frps)?
Or do you think I have to fix this on the target webpage?
Thank you for your support and project.
frpc Version
0.45
frps Version
0.45
System Architecture
linux/amd64
Configurations
[common]
server_addr = myDomain
server_port = 8082
authentication_method = token
token =
log_level = trace
user = no_test2
[23]
type = https
plugin = https2https
subdomain = e7b65b443b14cb26a76f0660
plugin_local_addr = targetHost:82
plugin_crt_path = <path_to_cert>
plugin_key_path = <path_to_cert>
Logs
No response
Steps to reproduce
...
Tbh I dont know how to reproduce this bug, it happens only at this one webpage.
Affected area
@fatedier commented on GitHub (Dec 18, 2022):
You can change your webpage logic to generate the location header.
@cedricbieder commented on GitHub (Dec 18, 2022):
Ok thank you, but what if I can not change the webpage header (e.g., it is not my webpage)?
@penguine commented on GitHub (Dec 18, 2022):
he could - similar to:
plugin_host_header_rewrite
change the location?
see: https2https.go New HTTPS2HTTPSPlugin
he should still be able to set the port too, right?
he would therefore have to expand the plugin_host_header_rewrite
@penguine commented on GitHub (Dec 23, 2022):
I found this hint:
https://github.com/golang/go/issues/28168
the problem seems to be fixed. but could still have something to do with it.
I have found another workaround (without the fix). now you have to test it.
@fatedier commented on GitHub (Dec 26, 2022):
Try this config.
@cedricbieder commented on GitHub (Dec 27, 2022):
@fatedier , thank you. I tried this already, but it just changes the host and not the port. He takes the port form "plugin_local_addr" instead. I could not finde where I can access the code to fix that or why he takes the port from there.
@penguine commented on GitHub (Dec 29, 2022):
a configuration now works with:
but this does not solve all problems. i also have like: @cedricbieder
a page where, the port in the location is set wrong. target server is an IIS. in the reponse header the location can not be set correctly. the URL can be changed, but the port is then always the port of the target computer and not that of the frps ... any further ideas?
@github-actions[bot] commented on GitHub (Jan 29, 2023):
Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.