Question

Dokku and preventing random domains

Posted October 9, 2014 2.2k 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 http://mdtn.point.li and http://developedthe.net however if I got to lets say http://randomsub.point.li I still get served my site.

Is there anyway I can stop this?

Thanks in advance

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
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

Submit an Answer