You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用ngrok共享localhost:8080/viewer/页面报错的解决咨询

解决ngrok跳转本地指定页面的问题
  • 直接追加路径访问:运行ngrok http 8080拿到公共链接后,在链接末尾加上/viewer/即可。比如生成的链接是https://xxxx.ngrok.io,就访问https://xxxx.ngrok.io/viewer/,直接打开目标页面。

  • 修改本地服务器默认路由:在你本地网页的服务器配置里加个重定向规则,让访问根路径/时自动跳转到/viewer/。这样不管是本地打开localhost:8080还是用ngrok链接访问,都会直接进入目标页面,不用手动加路径。

  • 用ngrok配置文件指定默认路径:

    1. 创建ngrok.yml配置文件,写入以下内容:
    tunnels:
      viewer:
        proto: http
        addr: 8080
        path: /viewer
    
    1. 执行命令ngrok start viewer,生成的公共链接会直接映射到localhost:8080/viewer/,打开就能看到目标页面。

内容的提问来源于stack exchange,提问作者User_289

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.23 14:52:08