【发布时间】:2021-12-08 09:31:07
【问题描述】:
我在网络服务器上有一个应用程序(Openproject)。 这是在http://10.0.0.1:8000/下可达的
在我的用户和网络服务器后面是一个 NGinx,我需要在一个特定的 URL 下发布它:https://ngrp.com/openproject
所以我在我的 Nginx 配置中进行了以下更改(在这个 NGINX 实例中,多个网站使用“位置”设置发布):
location /openproject/ {
proxy_pass http://10.0.0.1:8000/;
include /etc/nginx/conf.d/proxy.conf;
}
但是当我通过 Reverseproxy 打开页面时,Webbrowser 只显示一个白页。
在 Webbrowser 调试器中,我看到某些路径是错误的,因此浏览器无法加载它。示例:
https://ngrp.com/assets/frontend/styles.c3a5e7705d6c5db9cfc1.css (URL 中缺少 /openproject/)
正确的是:
https://ngrp.com/openproject/assets/frontend/styles.c3a5e7705d6c5db9cfc1.css
那么有人可以告诉我,需要什么配置,这样我就可以在 URL https://ngrp.com/openproject/ 下成功打开项目了吗?
非常感谢。
【问题讨论】:
标签: nginx nginx-reverse-proxy nginx-location openproject