mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #4927] Cannot proxy service exposed by frp in nginx #3887
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#3887
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 @HawtinZeng on GitHub (Aug 11, 2025).
Original GitHub issue: https://github.com/fatedier/frp/issues/4927
Bug Description
Returns 404 after we request proxied backend interface.
frpc Version
0.63.0
frps Version
0.63.0
System Architecture
linux/amd64
Configurations
part of the nginx config:
location /api/ {
proxy_pass http://api.hawtin.me:8085/;
proxy_set_header Host $host; # Important: Preserve original Host header
# proxy_set_header X-Forwarded-For $realip_remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr; # Optional: Forward client's IP
}
frps config:
bindPort = 7000
vhostHTTPPort = 8085
frpc confg:
serverAddr = "38.180.149.57"
serverPort = 7000
proxies
name = "ssh"
type = "tcp"
localIP = "127.0.0.1"
localPort = 22
remotePort = 6000
proxies
name = "back-hawtin-blog"
type = "http"
localIP = "127.0.0.1"
localPort = 3006
customDomains = ["18.120.139.17","api.hawtin.me"]
Logs
No response
Steps to reproduce
...
Affected area
@HawtinZeng commented on GitHub (Aug 12, 2025):
It's seems like frp will check whether $host in http header is included in the customDomains in frpc.toml. I resolved this problem by comment
proxy_set_header Host $host; # Important: Preserve original Host headerin nginx config or add replaceapi.hawtin.mewithhawtin.mein frpc.toml customDomains fields.