Frp: 想用80端口访问内网服务

Created on 11 Oct 2018  ·  8Comments  ·  Source: fatedier/frp

Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly.
(为了节约时间,提高处理问题的效率,不按照格式填写的 issue 将会直接关闭。)

Use the commands below to provide key information from your environment:
You do NOT have to include this information if this is a FEATURE REQUEST

What version of frp are you using (./frpc -v or ./frps -v)?
0.21.0

What operating system and processor architecture are you using (go env)?
frps: ubuntu 16.04
frpc: centos 7.5

Configures you used:

frps.ini

[common]
bind_port = 7000
vhost_http_port = 8080
token = mytoken

frpc.ini

[common]
server_addr = serverIP
server_port = 7000
token = mytoken

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000

[web]
type = http
local_port = 80
custom_domains = www.mydomain.com

server nginx

upstream localserver {
server www.mydomain.com:8080;
}

server
{
listen 80;
server_name *.mydomain.com;

location / {
proxy_pass http://localserver;
}
}

Steps to reproduce the issue:

  1. 访问www.mydomain.com:8080 OK
  2. 访问www.mydomain.com 404

Describe the results you received:
server: [newhttp.go:209] http: proxy error: no such domain

Describe the results you expected:
可以通过80端口访问

Additional information you deem important (e.g. issue happens only occasionally):
*.mydomain.com 已A 到serverIP

Can you point out what caused this issue (optional)
是不是我nginx 配的不对?

Most helpful comment

谢谢,不过不是ISP的问题

All 8 comments

@wangxianfeng 说的不是一个事啊

申请备案没有?

域名是已备案

先忘了问,你的外网 IP 的 80 端口能否连入?也就是没被 ISP 屏蔽。
如果不能,把相关手续拿到 ISP 那里申请开通端口;
否则就是软件或网络配置错误。

谢谢,不过不是ISP的问题

大概是这样吧

frps.ini (公网 IP)

[common]
bind_port = 7000
vhost_http_port = 80
token = mytoken

frpc.ini(内网服务器)

[common]
server_addr = serverIP
server_port = 7000
token = mytoken

[web]
type = http
local_port = 内网服务器端口
custom_domains = www.mydomain.com

楼上正解

vhost_http_port = 80

Was this page helpful?
0 / 5 - 0 ratings