mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 16:15:49 -06:00
[GH-ISSUE #3298] using nginx reverse proxy with frp and type = tcp #2641
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#2641
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 @zaalgol on GitHub (Feb 9, 2023).
Original GitHub issue: https://github.com/fatedier/frp/issues/3298
Bug Description
In our application, we create a frp tunnel from the local-server to the public server, so the public server can send data to the local-server. In the config we defined the type to be http, and defined a domain.
The public server uses another proxy - nginx reverse proxy to route client requests to the local server address..
It works great.
We have a customer that wants to add his private proxy, that all data from public server to local-server should pass through it. Because frp supports http_proxy only with type=tcp, as a beginning I changed config to type=tcp, but because the type=tpc doesn’t support domains, I get a error in the public server frp:
[http.go:92] do http proxy request error: no such domain: SUBDOMAIN GENERATED FROM SECRET AND RAW SUBDOMAIN.RAW SUB DOMAIN
frpc Version
0.35.1
frps Version
0.35.1
System Architecture
linux VM on a cloud
Configurations
frpc.ini:
frps.ini:
Nginx config:
Logs
[http.go:92] do http proxy request error: no such domain: <SUBDOMAIN GENERATED FROM SECRET AND RAW SUBDOMAIN.RAW SUB DOMAIN>Steps to reproduce
...
Affected area
@Becods commented on GitHub (Feb 10, 2023):
OR
@zaalgol commented on GitHub (Feb 10, 2023):
Hi @Becods,
Thanks for your response!
I tried the solution you suggested, and changed the 2 configurations.
The local server frp side runs OK. Logs:
Also the public server frp runs well. Logs:
The problem is in the nginx reverse proxy.
If I set the port in proxy_pass to 8080, I get the following error, when sending a request from public server to local server:
If I set the port in proxy_pass to 8081, I get the following error, when sending a request from public server to local server:
<IP> - - [10/Feb/2023:12:53:36 +0000] "GET /v1/api/<LOCAL SERVER ID><REQUEST> HTTP/1.1" 502 166 "-" "python-requests/2.25.1"It is worth noting that in the old logic in which I used http, the log in nginx proxy was:
<IP> - - [13/Feb/2023:09:09:38 +0000] "GET /v1/api/<SUBDOMAIN GENERATED FROM SECRET AND RAW SUBDOMAIN>/<REQUEST>HTTP/1.1" 200 51 "-" " python-requests/2.25.1"As you can see, it is directed at port 51, unlike the one I changed to tcp, which is directed at other ports.
Maybe need to make a change also in frps.ini?
Or maybe need to do a different change in frpc.ini?