skip to Main Content

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:
enter image description here

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


  1. Chosen as BEST ANSWER

    A solution: Use http reverse proxy instead of https reverse proxy:

    apache2 as a http reveverse proxy:
        ProxyRequests Off
        ProxyPass /rundeck/ http://rundeckhost.domain:4440/rundeck/
        ProxyPassReverse /rundeck/ http://rundeckhost.domain:4440/rundeck/
    
    nginx as a reverse proxy:
        location /rundeck/ {
            proxy_http_version 1.1;
            proxy_pass http://rundeckhost.domain:4440/rundeck/;
        }
    
    framework.properties:
    framework.rundeck.url = http://reverseproxy.domain/rundeck/
    
    rundeck-config.properties:
    grails.serverURL=http://reverseproxy.domain/rundeck/
    server.servlet.context-path = /rundeck
    

  2. 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).

    Login or Signup to reply.
  3. 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

    RUNDECK_GRAILS_URL="external-rundeck.com/rundeck"
    RUNDECK_SERVER_CONTEXTPATH=/="/rundeck"
    RUNDECK_SERVER_FORWARDED=true
    

    set above configurations in deployment file as environment variables

    step 2:
    In nginx

    location /rundeck/ {
    
    proxy_pass http://internal-rundeck.com:4440/rundeck/;
    
    }
    

    add this in your nginx config file it works

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search