Dokku and preventing random domains

October 9, 2014 2.1k views

I have a dokku instance set up and all seems to be working fine however if I hit random subdomains instead of being served a 404 or site not found I get served what seems to be the last application I deployed.

for example I have just deployed my personal site at and however if I got to lets say I still get served my site.

Is there anyway I can stop this?

Thanks in advance

1 Answer

It's because nginx is only loading the configs from docker it will default to the last server defined. All you need to do is enable the default server config:

cp /etc/nginx/sites-available/default /etc/nginx/sites-enabled/
nginx -s reload

That way nginx has a default config to go to – you could update /etc/nginx/sites-available/default to place your own 404 or holding page.

I hope that helps

Have another answer? Share your knowledge.