Frp: nginx代理frps后出现 http proxy request error: no such domain

Created on 18 Nov 2019  ·  5Comments  ·  Source: fatedier/frp

服务器端口
nginx 80
bind_port = 7000
vhost_http_port=7000

在nginx中代理frps的配置

upstream frps {
  server 127.0.0.1:7000;
}

server {
  listen 80;
  server_name localhost;
  index index.htm index.html;

  location / {
    proxy_pass http://frps;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    error_log  /var/log/nginx/frps.error.log;
    access_log  /var/log/nginx/frps.access.log;
  }
}

启动nginx
启动frps
启动frpc
frpc客户端配置

[common]
server_addr = xxx
server_port = 80
protocol = websocket

[001-80]
type = http
local_port = 80
custom_domains = 001.example.com,002.example.com

[001-80]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000

测试ssh连接成功
但是测试http却是失败界面显示显示如下
image

frps的日志是

[W] [http.go:95] do http proxy request error: no such domain: frps /

这个问题改如何解决呢?

Most helpful comment

nginx反向代理少了这个:

proxy_set_header Host $host;

All 5 comments

custom_domains = 001.example.com,002.example.com 和你访问的 domain 不匹配。

@fatedier 只可能是这一个原因吗?
域名匹配,我是粘贴复制的

看日志, [W] [http.go:95] do http proxy request error: no such domain: frps /,已经说明了是 domain 错误。

nginx反向代理少了这个:

proxy_set_header Host $host;

Thank you @acmookey , helpped me a lot.

Was this page helpful?
0 / 5 - 0 ratings