I want to use rundeck with NBINX reverse proxy but not working as exptected.
rundeck is at:
http://host.domain:4440/rundeck
nginx reverse proxy is at:
https://host.domain/rundeck
nginx’s configuration:
location /rundeck/ {
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Proto https;
proxy_pass http://192.168.1.102:4440/rundeck/;
}
rundeck’s customize:
RUNDECK_SERVER_CONTEXTPATH=/rundeck
RUNDECK_SERVER_FORWARDED=true
https://host.domain/rundeck shows:
Is there any way to fix this problem ?
The browser’s development console shows the following error:
Cannot read: https://host.domain/rundeck/assets/menu/knockout.mapping.min.js.map HTTP error 404、net::ERR_HTTP_RESPONSE_CODE_FAILURE
A solution:
Use http reverse proxy instead of https reverse proxy:
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
3
Answers
A solution: Use http reverse proxy instead of https reverse proxy:
Make sure that
grails.serverURL
(at rundeck-config.properties file,RUNDECK_GRAILS_URL
Docker env var) parameter is pointing to the proxy exit URL (https://host.domain/rundeck
in your case).Also, try with the latest version of Firefox/Chrome (same issue).
lets assume your rundeck is running in internal server with domain name "internal-rundeck.com:4440" and you want to expose it on "external-rundeck.com/rundeck" domain through nginx—follow below steps
step 1:
In rundeck
set above configurations in deployment file as environment variables
step 2:
In nginx
add this in your nginx config file it works