Frp 隐藏 8080 端口

Nginx 反向代理配置

  • 添加 Nginx 配置文件

sudo vi /etc/nginx/conf.d/vhost.conf

内容

server
{
    listen 80;
    server_name a.com;
    location / {
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://127.0.0.1:8080;
    }
    access_log /var/log/nginx/a.com_access.log;
}


server
{
    listen 80;
    server_name b.com;
    location / {
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://127.0.0.1:8080;
    }
    access_log /var/log/nginx/b.com_access.log;
}
  • 重启 Nginx
$ sudo systemctl reload nginx 

我的问题

用上面的配置,我没有成功。
最后直接 127.0.0.1 换成服务器 公网Ip 或者域名就成功了。

发布者

rockts

喜欢技术,乐于开源! 乐可开源,想改变的也只有世界!

18 thoughts on “Frp 隐藏 8080 端口”

  1. 不过还是有问题啦,如果把8080反代成 80 会和 FRP冲突吧……nginx会占用80端口撒FRPS就无法启动了哦

  2. 下面是客户端frps 在阿里云搭建

    2018/12/01 01:23:28 [I] [proxy_manager.go:300] proxy removed: []
    2018/12/01 01:23:28 [I] [proxy_manager.go:310] proxy added: [ip me]
    2018/12/01 01:23:28 [I] [proxy_manager.go:333] visitor removed: []
    2018/12/01 01:23:28 [I] [proxy_manager.go:342] visitor added: []
    2018/12/01 01:23:38 [W] [control.go:113] login to server failed: i/o deadline reached

    服务端:家里内网centos7 搭建

    2018/12/01 09:20:33 [I] [service.go:128] frps tcp listen on 0.0.0.0:7000
    2018/12/01 09:20:33 [I] [service.go:137] frps kcp listen on udp 0.0.0.0:7000
    2018/12/01 09:20:33 [I] [service.go:161] http service listen on 0.0.0.0:8090
    2018/12/01 09:20:33 [I] [service.go:182] https service listen on 0.0.0.0:4433
    2018/12/01 09:20:33 [I] [service.go:205] Dashboard listen on 0.0.0.0:8000
    2018/12/01 09:20:33 [I] [root.go:190] Start frps success
    2018/12/01 09:22:23 [I] [dashboard_api.go:67] Http request: [/api/serverinfo]
    2018/12/01 09:22:23 [I] [dashboard_api.go:64] Http response [/api/serverinfo]: code [0]
    2018/12/01 09:22:27 [I] [dashboard_api.go:67] Http request: [/api/serverinfo]
    2018/12/01 09:22:27 [I] [dashboard_api.go:64] Http response [/api/serverinfo]: code [0]

    博主请教下 这是什么原因呢

发表评论

电子邮件地址不会被公开。

This site uses Akismet to reduce spam. Learn how your comment data is processed.