Best way to add a small project to Trellis

Hey guys,

I made a project with Trellis/Bedrock/Sage and i need to add a small other project with its own domain name.

So in my (DO) provisioned server (/srv/www/) i have :

What is the best way to add my conf in Nginx ? Create a new conf ? Copy paste the project conf ? Can i use the same ssl certificate ? What command do i need to put in ?

Thanks for your answer.

I tried to create a new file in /etc/nginx/sites-available/ with :

server {
    listen 80;
    listen [::]:80;

    root /srv/www/smallproject.com;
    index index.html index.htm index.nginx-debian.html;

    server_name smallproject.com www.smallproject.com;

    location / {
        try_files $uri $uri/ =404;
    }
}

save this file and use :
ln -s /etc/nginx/sites-available/smallproject.com /etc/nginx/sites-enabled/
then :
systemctl restart nginx

But it doesn’t work, when i try to go on smallproject.com, it’s automatically switching in https://smallproject.com and i can show insecure connection.

Any idea ?

Thanks for your help.

That’s the entire conf file?

If you have SSL enabled on your WP site then Trellis enforces that. But it would only be for the domains on that WP site.

Was the domain you’re trying (smallproject.com) ever used on the WP site? Or part of your site_hosts?

Hey @swalkinshaw thanks for helping,

In fact, i start a website with Trellis/Bedrock/Sage with SSL and it’s works fine with https in a DO droplet production.

But today i need to add a small project (html/css/js at the moment) with a new domain name on the same droplet. So i added my domain name in DO on the same droplet ip and i tried to add a new conf file for Nginx (it’s my entire conf file yes) directly in my ssh Bitvise term, i dont touch my main (big) conf file generated by Trellis.

My new domain name was never used on my main wp project but i used it in an other trellis project (maybe with SSL, i don’t remember) for a test (deleted after).

Little up. Help is still needed please :slight_smile:

Anyone has idea or a solution for that ? Or anyone knows how to use SSL in the same way or desactivate https for this non-wp site on production droplet ?

I’m stuck, i don’t understand what i missed…

Thanks

I’ve configured multiple sites on a single trellis, based off this article: https://fatpony.me/multiple-sites-on-a-single-vagrant-box/