mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #2393] http 路由模式, 可以对路径重写吗? 类似 Nginx 的路径重写. #1900
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#1900
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Nisus-Liu on GitHub (May 13, 2021).
Original GitHub issue: https://github.com/fatedier/frp/issues/2393
http://web.example.com/news访问到 web02 服务, 但是 web02 接受到请求路径带了/news前缀.有这个前缀, web02 服务可能会导致错误的资源访问.
可以做到配置将
/news前缀去掉吗?类似 Nginx 的路径重写.
@fatedier commented on GitHub (May 14, 2021):
暂时没有这样的计划,这一部分会比较复杂,frp 通常只做简单的路由,可以在你自己的服务前挡一个 nginx 来完成,否则就相当于在 frp 中逐渐实现 nginx 中的功能,有点本末倒置。
不过也许之后会尝试在 frpc 这一层提供一个可选的类似 nginx 这样的 HTTP server 的插件,提供一些丰富的基于 HTTP 的扩展能力。这样可以把这部分独立在主项目之外,可以单独维护。
@Nisus-Liu commented on GitHub (May 14, 2021):
嗯, 有道理. 我现在就是用 nginx 来处理的. 3Q~
@Greybeetle commented on GitHub (Aug 20, 2021):
你好,请问你是怎么实现的呢,是要在服务端配置nginx还是客户端上配置?
@Greybeetle commented on GitHub (Aug 20, 2021):
我的frps.ini配置如下
然后我在服务器上配置了nginx,代码如下:
通过web.example.com:4545/dsm 或者 web.example.com:4545/file 均没有办法访问对应的服务。但是在不配置路由的情况下,直接使用
则可以通过web.example.com:4545访问第一个服务,请能帮忙看看我的思路有什么问题吗