Many domains and sub-domains local.conf


On my box I need to create many accounts for many domains and subdomains, the problem is that mailinabox writes a new server block for all the domains even-though want them all to serve the same files.

This makes a huge .conf file which breaks my server.

How can I disable the creation of different server blocks and make it a catch all?

I tried to mess with mailinabox/management/

Does anybody have a suggestion?

Thank you

create one directory, and create a link to the directory and all the default directories

I think you’ll have to do it manually by editing the /etc/nginx/config.d/local.conf. Be sure to make a backup copy first. Then restart NGINX.

For that first server block, use the format below for port 80 and port 443, then delete the other server blocks.

listen 80 default_server;
server_name _; # This is just an invalid value which will never trigger on a real host

You may have SSL issues, but the conf file makes it look like they all use the same cert.

Thank you for helping, I tried that but to listen to 443 and it did not work, is it because it was https?

I think I need to change something in the Mailinabox maintenance files to not create different blocks in local.conf but to issue certificates and provide the certificate information in local.conf for each domain but in the same block.

How do I do that?