【发布时间】:2021-08-22 00:33:48
【问题描述】:
我想使用带有 NBINX 反向代理的 rundeck,但没有按预期工作。
rundeck 位于: http://host.domain:4440/rundeck nginx 反向代理位于: https://host.domain/rundeck
nginx的配置:
location /rundeck/ {
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Proto https;
proxy_pass http://192.168.1.102:4440/rundeck/;
}
rundeck 的定制: RUNDECK_SERVER_CONTEXTPATH=/rundeck RUNDECK_SERVER_FORWARDED=true
https://host.domain/rundeck 显示:
有没有办法解决这个问题? 浏览器的开发控制台显示以下错误: 无法读取:https://host.domain/rundeck/assets/menu/knockout.mapping.min.js.map HTTP 错误 404、net::ERR_HTTP_RESPONSE_CODE_FAILURE
解决方案: 使用 http 反向代理而不是 https 反向代理:
apache2 as a http reveverse proxy:
ProxyRequests Off
ProxyPass /rundeck/ http://host.domain:4440/rundeck/
ProxyPassReverse /rundeck/ http://host.domain:4440/rundeck/
nginx as a reverse proxy:
location /rundeck/ {
proxy_http_version 1.1;
proxy_pass http://host.domain:4440/rundeck/;
}
framework.properties:
framework.rundeck.url = http://host.domain/rundeck/
rundeck-config.properties:
grails.serverURL=http://host.domain/rundeck/
server.servlet.context-path = /rundeck
【问题讨论】:
标签: nginx reverse-proxy rundeck