Comments (4)
先弄清楚 localAddr
与 localIP
的使用场景
from frp.
首先,非常感谢您的回复,为我解答疑惑,其次抱歉,我在文档中,并没有找到localAddr
的使用案例,也没有找到讲解方法,但是我不使用localAddr
或localIP
时,在客户端设置remotePort = 58880
,服务端设置vhostHTTPPort = 58880
时,我使用curl http://127.0.0.1:58880
,一样会产生错误,导致我无法使用nginx反向代理设置。错误如下图
访问http://127.0.0.1:58880
frps配置
`bindAddr = "0.0.0.0"
bindPort = 60001
vhostHTTPPort = 58880
log.to = "console"
auth.method = "token"
auth.token = "xxxxxxxxxxx"
`
frpc配置
`serverAddr = "1.1.1.1" # 这里我写的是真实ip,1.1.1.1只是临时填写
serverPort = 60001
auth.method = "token"
auth.token = "xxxxxxxxxxx"
[[proxies]]
name = "lskyweb"
type = "http"
localIP = "127.0.0.1"
localPort = 8080
remotePort = 58880
customDomains = ["1.1.1.1"] # 这里我写的是真实ip,1.1.1.1只是临时填写
`
frps错误日志
[W] [http.go:119] do http proxy request [host: 127.0.0.1:58880] error: no route found: 127.0.0.1 /
此时如果我的vps开放了58880端口,使用curl http://x.x.x.x:58880
这个时候是可以正常访问的,唯独访问localhost、127.0.0.1或内网ip的58880端口无法访问
from frp.
我看到,您在其他nginx反向代理的issue中提到要先添加localIP
,那么我添加localIP
后,配置如下:
`serverAddr = "1.1.1.1"
serverPort = 60001
auth.method = "token"
auth.token = "xxxxxxx"
[[proxies]]
name = "lskyweb"
type = "http"
localIP = "127.0.0.1"
localPort = 8080
remotePort = 58880
customDomains = ["1.1.1.1"]
`
但是依旧会无法访问localhost、127.0.0.1或内网ip的58880端口,但是可以通过公网ip进行访问,我在公网服务器的shell中
访问错误如下:
2024/01/06 22:09:16 [W] [http.go:119] do http proxy request [host: 127.0.0.1:58880] error: no route found: 127.0.0.1 /
from frp.
已经搞明白如何进行反向代理的设置了,需要把customDomains = ["1.1.1.1"]这个配置为customDomains = ["127.0.0.1"],就会默认转发到他的127.0.0.1:58880端口上,这样就可以做nginx反向代理了
from frp.
Related Issues (20)
- [Feature Request] 打洞代码参数使用疑惑 HOT 1
- [web] start error: type [http] not supported when vhost http port is not set HOT 3
- 使用NPM+FRP,公网ip可以成功,localhost失败? HOT 3
- 0.53.以后支持的SSH reverse tunneling功能怎么用?有没有大佬教程 HOT 2
- ssh登陆失败 HOT 1
- frpc
- 请求大佬解答服务器自动删除了我的frpc可执行文件怎么办 HOT 3
- Wiki介绍参考配置不明 HOT 2
- 0.53版本问题 HOT 2
- [Feature Request] 为啥没有基于udp的 P2P打洞 P2P怎么实现UDP的呢 HOT 6
- 有没有限制连接的方法 HOT 5
- [Feature Request] 穿透限速问题!? HOT 1
- Reverse proxy a VPN or Fiddler connection reset by peer HOT 2
- 子域名长度不得超过15位,否则无法内网穿透 HOT 4
- 为什么流量一大[服务端上行1M], 穿透就挂了 HOT 2
- 分享一个用于 frps 的 Grafana 的仪表盘 HOT 6
- stcp,代理的 sftp和rsync 连接异常 HOT 4
- [Feature Request] 可配置 Websockets 路径
- webside on a kubernet ends in "default backend - 404"
- 求助几个关于安全性和真实IP的问题 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from frp.