Set default URL, default site, etc when disabling site on host with >1 sites

Hi,

Love your work.

I have a question. I wanted to disable a couple of my client’s sites, and so I used the

ee site disable example-site.com

command to disable the site in question.

However, once I did this, it defaulted to another site on the host. Is there a way to have a default page show when a site is disabled, or is there a default site that can be set, etc?

I would like the site disabled, but I don’t want another client’s website to show instead.

Thanks very much for all your hard work, guys.

Much appreciated.

JW

Try following:

  1. Edit default site config
  
ee site edit default  
  1. Add following line after server { line:
  
listen   80 default_server;  

This will make sure nginx’s default site (the one you see when you type site’s IP address in browser) shows up for any non existent domain.

If you see “Welcome to nginx!” page after this, you can edit that default page content by editing html file - /usr/share/nginx/www/index.html

Please let me know if this works for you.

Rahul,

Thanks for the reply. I noticed that there was no default file in the /etc/nginx/sites-available/ folder. I added the file from another instance of easyengine, but when I put in the IP address of my server it still brings up one of the several websites I am hosting on the server, and not an Nginx default page.

After adding the file, I restarted Nginx using

service nginx restart

Could it be a symbolic link issue? I added the file using nano, and copied and pasted the file contents.

Did not want to mess with it until I responded to your response.

Thanks very much.

JW

After following your instructions, I was able to set the symbolic link for the default site by using the command

ee site enable default

This fixed the issue, and I was able to edit the file you mentioned at

/usr/share/nginx/www/index.html

Thank you.

Hello @marketfuse,

Glad to know your issue is resolved. I am closing this support ticket.

Feel free to create a new support ticket if you have any queries further. :slight_smile: