FastGPT icon indicating copy to clipboard operation
FastGPT copied to clipboard

Hello, I want to access fastgt normally on http://localhost:3000/test. Can this requirement be realized?

Open TheChalice opened this issue 1 year ago • 8 comments

例行检查

  • [x] 我已确认目前没有类似 features
  • [x] 我已确认我已升级到最新版本
  • [x] 我已完整查看过项目 README,已确定现有版本无法满足需求
  • [x] 我理解并愿意跟进此 features,协助测试和提供反馈
  • [x] 我理解并认可上述内容,并理解项目维护者精力有限,不遵循规则的 features 可能会被无视或直接关闭

功能描述 您好,我想在http://localhost:3000/test上正常访问fastgt,请问这个需求可以实现吗,我在next.config.js里加了 basePath: '/test',但这样就会让api全部404,请问您这边有什么好的解决方案吗 应用场景

相关示例

TheChalice avatar Dec 28 '23 08:12 TheChalice

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Routine inspection

  • [x] I have confirmed that there are currently no similar features
  • [x] I have confirmed that I have upgraded to the latest version
  • [x] I have fully reviewed the project README and determined that the existing version cannot meet the needs.
  • [x] I understand and am willing to follow up on this feature, assist with testing and provide feedback
  • [x] I understand and agree with the above content, and understand that project maintainers have limited energy. Features that do not follow the rules may be ignored or closed directly

Function description Hello, I want to access fastgt normally on http://localhost:3000/test. Can this requirement be achieved? I added basePath: '/test' to next.config.js, but this will make the api all 404, do you have any good solutions here? Application Scenario

Related Examples

c121914yu avatar Dec 28 '23 08:12 c121914yu

这个可以考虑 nginx 重定向。

c121914yu avatar Dec 31 '23 06:12 c121914yu

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Is it written like this? server { listen 8888;

server_name 10.1.251.131;


location /test/ {
    rewrite ^/test/(.*)$ /$1 break;
    proxy  

c121914yu avatar Jan 02 '24 01:01 c121914yu

请问可以这样写吗

TheChalice avatar Jan 02 '24 01:01 TheChalice

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Could you please write it like this?

c121914yu avatar Jan 02 '24 01:01 c121914yu

nginx.conf.txt

TheChalice avatar Jan 02 '24 01:01 TheChalice

nginx.conf.txt

估计不太行,在接口中使用的都是 / 的相对域名地址。

c121914yu avatar Jan 17 '24 03:01 c121914yu

nginx.conf.txt

估计不太行,在接口中使用的都是 / 的相对域名地址。

我只设置过,拦截 /api,转向其他地方。

c121914yu avatar Jan 17 '24 03:01 c121914yu

nginx.conf.txt

请你问解决二级路由重定向的问题了吗,我也遇到了和你相同的问题

Timerunning avatar Aug 05 '24 08:08 Timerunning