[GH-ISSUE #943] 想用80端口访问内网服务 #748

Closed
opened 2026-05-05 12:28:47 -06:00 by gitea-mirror · 8 comments
Owner

Originally created by @xchao0213 on GitHub (Oct 11, 2018).
Original GitHub issue: https://github.com/fatedier/frp/issues/943

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 配的不对?

Originally created by @xchao0213 on GitHub (Oct 11, 2018). Original GitHub issue: https://github.com/fatedier/frp/issues/943 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 配的不对?
Author
Owner
<!-- gh-comment-id:428785321 --> @wangxianfeng commented on GitHub (Oct 11, 2018): 参考这个试试看 http://www.wangxianfeng.cn/wordpress/2018/06/10/nginx%e5%8f%8d%e5%90%91%e4%bb%a3%e7%90%86frp%e7%bc%93%e5%ad%98%e5%8a%a0%e9%80%9fhttphttps/
Author
Owner

@xchao0213 commented on GitHub (Oct 11, 2018):

@wangxianfeng 说的不是一个事啊

<!-- gh-comment-id:428819940 --> @xchao0213 commented on GitHub (Oct 11, 2018): @wangxianfeng 说的不是一个事啊
Author
Owner

@SeaHOH commented on GitHub (Oct 11, 2018):

申请备案没有?

<!-- gh-comment-id:428825283 --> @SeaHOH commented on GitHub (Oct 11, 2018): 申请备案没有?
Author
Owner

@xchao0213 commented on GitHub (Oct 11, 2018):

域名是已备案

<!-- gh-comment-id:428834378 --> @xchao0213 commented on GitHub (Oct 11, 2018): 域名是已备案
Author
Owner

@SeaHOH commented on GitHub (Oct 11, 2018):

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

<!-- gh-comment-id:428835985 --> @SeaHOH commented on GitHub (Oct 11, 2018): 先忘了问,你的外网 IP 的 80 端口能否连入?也就是没被 ISP 屏蔽。 如果不能,把相关手续拿到 ISP 那里申请开通端口; 否则就是软件或网络配置错误。
Author
Owner

@xchao0213 commented on GitHub (Oct 11, 2018):

谢谢,不过不是ISP的问题

<!-- gh-comment-id:428837295 --> @xchao0213 commented on GitHub (Oct 11, 2018): 谢谢,不过不是ISP的问题
Author
Owner

@SeaHOH commented on GitHub (Oct 11, 2018):

大概是这样吧

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
<!-- gh-comment-id:428853566 --> @SeaHOH commented on GitHub (Oct 11, 2018): 大概是这样吧 ### frps.ini (公网 IP) ```ini [common] bind_port = 7000 vhost_http_port = 80 token = mytoken ``` ### frpc.ini(内网服务器) ```ini [common] server_addr = serverIP server_port = 7000 token = mytoken [web] type = http local_port = 内网服务器端口 custom_domains = www.mydomain.com ```
Author
Owner

@TomLiu-GitHub commented on GitHub (Oct 11, 2018):

楼上正解

vhost_http_port = 80

<!-- gh-comment-id:428855295 --> @TomLiu-GitHub commented on GitHub (Oct 11, 2018): 楼上正解 > vhost_http_port = 80
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#748
No description provided.