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

关于本系统做为nginx的反向代理,被上层服务调用时,资源路径的问题 #39

Open
micie opened this issue Jul 30, 2019 · 2 comments

Comments

@micie
Copy link

micie commented Jul 30, 2019

George你好,
我有一个这样的问题:
这个系统装好后默认各路径(前端资源或后端请求api)都是从根(/)开始的,能改为从一个二级目录开始吗?
或者换个说法:我能把本系统安装在一个二级目录里,并正常使用吗?

我有一个这样的场景:
两台机器,机器A和机器B,其中机器A通外网,有外网IP,机器B不通外网,和机器A在同一内网,PPGo_job安装在机器B上并监听了8080;

域名xxx.abc.com解析到机器A,机器A有nginx解析了xxx.abc.com,但有限制:只能解析xxx.abc.com,不能解析其他子域名,也只能解析80端口,不能解析其他端口;

所以我如果想用本系统,就只能用一个二级目录的URL如:xxx.abc.com/ppgojob/来访问,于是在机器A上的Nginx配置里,加了一条/ppgojob/的规则:反向代理到机器B的8080;

这时就是问题:机器B上的本系统的前端代码、ajax后端的api请求的URL都是从根开始的,即(/static/layui/css/layui.css?t=1504439386550这样的),但我需要/ppgojob/static/layui/css/layui.css?t=1504439386550才对,所以,有没有什么办法快速的修改这些代码,或者有哪里可配置吗

@micie
Copy link
Author

micie commented Aug 16, 2019

求解答

@linguohu
Copy link

我也遇到相同问题

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

2 participants