Web app context for rancher

Hi all,

First of all thank you for this amazing tool!

I’m using rancher behind nginx, and I want to it to point at domain.com/rancher, here is my configuration :

upstream rancher{
server {
    listen 443;
    server_name  domain.com;
    ssl on;
    ssl_certificate /etc/ssl/certs/fullchain.pem;
    ssl_certificate_key /etc/ssl/certs/privkey.pem;
   #        ssl_protocols TLSv1.1 TLSv1.2;
   #        ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
   #        ssl_prefer_server_ciphers on;
   #        ssl_session_cache shared:SSL:10m;
    # disable any limits to avoid HTTP 413 for large image uploads
    client_max_body_size 0;
    # required to avoid HTTP 411: see Issue #1486 (https://github.com/docker/docker/issues/1486)
    chunked_transfer_encoding on;
    add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
    location /rancher/ {
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-Port $server_port;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass http://rancher/;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    # This allows the ability for the execute shell window to remain open for up to 15 minutes. Without this parameter, the default is 1 minute and will automatically close.
    proxy_read_timeout 900s;
server {
     listen 80;
     server_name domain.com;
     return 301 https://$server_name$request_uri;

now if I go to domain.com/rancher, the login page shows, but all the assets are 404 (domain.com/assets …).

I think this is due to the jetty WebContextPath, it’s set to “/”.

so my question, can we pass an env variable to the container for changing the context path??

Cheers from Morocco

PS : Sorry for the not so bad english :smile:

1 Like

This is not currently supported, the UI assumes it is running from /.

Okay, thanks vincent!

Is it on the roadmap? I’m working on a Rancher implementation, but this would be pretty essential in a production environment for us.


It is not, is there a reason you can’t use a subdomain or another port?


I have the same request.

All our application are behind a common URL. Having the choice to configure rancher behind domain.com/rancher would be great.

Lot of software have this option.
Having a dedicated domain for rancher can cost money for SSL certificate for exemple.

1 Like

Is this supported in rancher 2.0 ?