nginx代理pass子目录 [英] nginx proxy pass subdirectory
问题描述
我正在尝试使用以下配置设置代理以通过 nginx 访问 Rundeck 的安装:
I'm trying to setup a proxy to access an install of Rundeck through nginx with the following configuration :
location ^~ /rundeck/ {
proxy_pass http://rundeckIP:4440/;}
问题是 Rundeck 中的任何链接都会省略Rundeck"子目录.
The problem is that any link inside Rundeck would omit the "Rundeck" subdirectory.
所以,Rundeck 中的链接看起来像这样:http://mywebserver/menu/home 而不是
So, links inside Rundeck look like that : http://mywebserver/menu/home instead of http://mywebserver/rundeck/menu/home
尝试了很多配置 proxy_redirect 和 proxy_set_header 都没有成功.这是让我通过基本连接的最小配置.
Tried many configuration with proxy_redirect and proxy_set_header unsuccessfully. This is the smallest configuration that get me through with basic connection.
推荐答案
尝试更改您的/etc/rundeck/profile.您会在某处找到导出 RDECK_JVM"部分.添加此选项:
Try changing your /etc/rundeck/profile. Somewhere you'll find the 'export RDECK_JVM' section. Add this option:
-Dserver.web.context=/rundeck \
这篇关于nginx代理pass子目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!