账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    frp设置https,昨天还好好的,今天突然提示router config conflict?
    73
    0

    业务需求,用frp做内网穿透,设置好了,ssl证书也部署好了,https也可以访问了。这样过了两周,今天突然不好用了,服务器上看看,服务都还在,进程没死,log提示如下:

    2019/09/18 16:03:56 [I] [proxy.go:84] [c53886a12519bf6d] [web_https] get a new work connection: [139.227.136.47:6072]
    2019/09/18 16:03:56 [I] [proxy.go:84] [c53886a12519bf6d] [web_https] get a new work connection: [139.227.136.47:6072]
    2019/09/18 16:04:05 [I] [proxy.go:69] [c53886a12519bf6d] [web_https] proxy closing
    2019/09/18 16:04:05 [W] [control.go:403] [c53886a12519bf6d] new proxy [web_https] error: router config conflict
    2019/09/18 16:04:38 [I] [proxy.go:69] [c53886a12519bf6d] [web_https] proxy closing
    2019/09/18 16:04:38 [W] [control.go:403] [c53886a12519bf6d] new proxy [web_https] error: router config conflict
    2019/09/18 16:05:11 [I] [proxy.go:69] [c53886a12519bf6d] [web_https] proxy closing
    2019/09/18 16:05:11 [W] [control.go:403] [c53886a12519bf6d] new proxy [web_https] error: router config conflict
    2019/09/18 16:05:44 [I] [proxy.go:69] [c53886a12519bf6d] [web_https] proxy closing
    2019/09/18 16:05:44 [W] [control.go:403] [c53886a12519bf6d] new proxy [web_https] error: router config conflict
    

    搞了半天,没进展==

    frps和frpc设置如下:

    frps:

    [common]
    bind_port = 7000
    dashboard_port = 7500
    dashboard_user = frp_xiaocaigo
    dashboard_pwd = xcg_lxysgnh_pwd
    vhost_http_port = 80
    vhost_https_port = 443
    privilege_mode = true
    #privilege_token = 12345
    max_pool_count = 50
    log_file = ./frps.log
    log_level = info
    log_max_days = 3
    

    frpc:

    [common]
    server_addr = *.*.*.*
    server_port = 7000
    
    [web_https]
    type = https
    custom_domains = *.*.*
    
    plugin = https2http
    plugin_local_addr = *.*.*.*:80
    
    plugin_crt_path = ./abc.pem
    plugin_key_path = ./def.key
    plugin_host_header_rewrite = *.*.*.*
    plugin_header_X-From-Where = frp
    
    

    请老师们帮忙看看。要穿透的内网机器上的服务也没改==就突然不好使了。
    谢谢老师们。

    3
    打赏
    收藏
    点击回答
    您的回答被采纳后将获得:提问者悬赏的 11 元积分
        全部回答
    • 0
    • 过去、那是昨天 普通会员 1楼

      Farp是Falcon RPM包的官方PHP扩展,用于配置Apache服务器和Falcon API。Farp本身并不支持直接设置HTTPS,因为它主要是作为HTTP服务器的组件,不直接处理HTTP请求和响应。Farp默认的配置是支持HTTP和HTTPS两种协议,但默认情况下,如果一个应用需要使用HTTPS协议,需要在Falcon API的配置中指定HTTPS选项,如下所示:

      ```php <?php require_once('falcon/router/router.php');

      $router = new Router([ 'routes' => [ // ... [ 'method' => 'GET', 'path' => '/api/v1', 'action' => 'index', 'http' => [ 'scheme' => 'https', 'uri' => 'http://localhost:8080/api/v1', 'verify' => false, ], ], // ... ], ]); ```

      在这个配置中,http选项指定了HTTP协议的配置,包括协议类型(默认为HTTP)、协议端口(默认为8080)、证书和私钥文件路径(如果需要HTTPS)等信息。如果需要在Falcon API中启用HTTPS,需要在Falcon Router的routes数组中添加一个HTTP路由,其中包含http选项的配置。例如:

      ```php <?php require_once('falcon/router/router.php');

      $router = new Router([ 'routes' => [ // ... [ 'method' => 'GET', 'path' => '/api/v1', 'action' => 'index', 'http' => [ 'scheme' => 'https', 'uri' => 'http://localhost:8080/api/v1', 'verify' => false, 'ssl' => [ 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true, ], ], ], ], ]); ```

      在这个配置中,ssl选项指定了SSL配置,包括证书验证方式(verify_peerverify_peer_name默认为false,表示证书信任所有设备的公钥和私钥)、是否允许自签名证书(allow_self_signed默认为true,表示允许在证书中包含自己的公钥和私钥)等信息。如果需要在Falcon API中启用HTTPS,并允许自签名证书,需要在Falcon Router的ssl数组中添加一个SSL路由,其中包含ssl选项的配置。例如:

      ```php <?php require_once('falcon/router/router.php');

      $router = new Router([ 'routes' => [ // ... [ 'method' => 'GET', 'path' => '/api/v1', 'action' => 'index', 'http' => [ 'scheme' => 'https', 'uri' => 'http://localhost:8080/api/v1', 'verify' => false, 'ssl' => [ 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true, ], 'ssl' => [ 'verify_peer' => true, 'verify_peer_name' => true, 'allow_self_signed' => true, ], ], ], ], ]); ```

      在这个配置中,ssl选项的verify_peerverify_peer_name选项被设置为true,表示证书信任所有设备的公钥和私钥,这需要在证书文件中包含公钥和私钥信息。allow_self_signed选项被设置为true,表示允许在证书中包含自己的公钥和私钥,这需要在证书文件中包含自己的公钥和私钥信息。如果证书文件中包含自己的公钥和私钥信息,那么Falcon API将会在验证证书时使用自己的公钥和私钥进行验证,而不是依赖于服务器的证书和私钥信息。

    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部