Hi ,
Can someone help me , I’m tried to setup Rancher behind Nginx reverse proxy .
I already look into
The problem is… it only work under " / " location … I tried to do something like this :
I have done some workaround using nginx … but i don’t think it’s good enough.
# Exact URI match to load the base rancher page without a redirect
location = /rancher {
proxy_pass https://rancherhost:443;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
# Catch for all other rancher resources. Removes proxy URI before passing on
location /rancher {
rewrite ^/rancher/(.*)$ /$1 break;
proxy_pass https://rancherhost:443;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
# Catch for a stray rancher call that doesn't properly prepend the proxy URI
location ~ ^/(assets|v3|v3-public|translations|update-setting|engines-dist|login)/ {
proxy_pass https://rancherhost:443;
}
i’m using Rancher 2.x on docker container.