Have been using MaaS for a few years now and really appreciate the effort that everyone has contributed to help make bare metal deployments easy and repeatable.
Something appears to have changed in how TLS termination works between MaaS 3.0 and MaaS 3.2. We’ve probably just missed something in the documentation, looking for someone who can point us in the right direction.
Per the docs we had been using an nginx reverse proxy to handle TLS termination
server {
listen 443 ssl;
server_name _;
ssl_certificate /etc/ssl/certs/maas01.example.com.pem;
ssl_certificate_key /etc/ssl/private/maas01.example.com.key;
location / {
proxy_pass http://localhost:5240;
include /etc/nginx/proxy_params;
}
location /MAAS/ws {
proxy_pass http://localhost:5240/MAAS/ws;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
}
What we see after upgrading is that when we browse to https://maas01.example.com
we are redirected to http://maas01.example.com:5420/MAAS/r/
This redirect appears to be coming from
/var/snap/maas/current/http/regiond.nginx.conf
Specifically lines 20-26
location = / {
return 301 /MAAS/r/;
}
location ~ ^/MAAS/?$ {
return 301 /MAAS/r/;
}
If users manually browse to https://maas01.example.com/MAAS/r/
TLS termination works as expected.
The newer documentation seems to recommend that HAProxy is used for TLS termination rather than Apache2 or Nginx. We did confirm that we see the exact same behavior if we use HAProxy instead of nginx
frontend maas
bind *:443 ssl crt /etc/ssl/private/maas01.example.com.pem
reqadd X-Forwarded-Proto:\ https
retries 3
option redispatch
default_backend maas
backend maas
timeout server 90s
balance source
hash-type consistent
server localhost localhost:5240 check
What is the recommended method for TLS termination to ensure that requests to https://maas01.example.com
get redirected to https://maas01.example.com/MAAS/r/
or appropriate path?