How to stop non registered sub domains from redirecting to admin interface?

You need to change nginx conf files. Something like

location / {
return 302 https://$http_host/yunohost/admin;
}

to

location / {
    return 302 https://$http_host/;

}

in /etc/nginx/conf.d/yunohost_admin.conf file, which seems to be used when you go on a subdomain not available on your yunohost instance.

You’ll have a warning in your browser (which search an available TLS certificate for the nonexisting domain), and nothing is showed.

It’s a way, it needs some improvment (to redirect to the page you want.

5 Likes