Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature-request] 希望前端使用相对路径 ./ 访问 api #39

Closed
magicdawn opened this issue Jun 16, 2024 · 1 comment
Closed

[feature-request] 希望前端使用相对路径 ./ 访问 api #39

magicdawn opened this issue Jun 16, 2024 · 1 comment

Comments

@magicdawn
Copy link

使用场景: 反向代理, 挂到 nginx / caddy

现在必须要下面的配置挂到 caddy, 前端 example.com/clip/, 但前端访问 api 使用的是绝对路径 /serverexample.com/server 等, 不好反代. 需要详细列出 api 里的路径(/server /text /revoke ...)才行.

#
# cloud-clipboard
#
redir /clip /clip/
handle_path /clip/* {
	reverse_proxy 127.0.0.1:9501
}
@clip-api path /server /text /revoke /revoke/* /upload /upload/* /file/* /push
handle @clip-api {
	reverse_proxy 127.0.0.1:9501
}

希望改为相对 html 的 ./server 地址, 或者 api 加上 prefix /cloud-clipboard-api/server /cloud-clipboard-api/text (但是这样要改不同语言实现的后端.....

Thanks.

@magicdawn
Copy link
Author

感谢 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant