Roots Discourse

Subdomain staging stopped working

I have 2 different droplets on DO. (one for the staging and one for production)

the staging website is a subdomain of the main website >

It was all ok until I activated the SSL in the main website >

after that, for some reason sometimes the staging doesn’t show up, I receive this msg " This site can’t be reached. refused to connect.
but sometimes works and I am able to see the staging website.

i tried to re-provisioning the staging server (always without the ssl) but I have the same problem.
I checked the site logs in /srv/www//logs but i didn’t see anything related.

I suspect that it is a problem with the SSL, because staging is looking for the https (but I never activated the SSL on the staging), and if I remember well, I think this problem came out only after I activated the SSL in the production.

i am not an SSL expert, it is a new thing for me, is it possible that the SSL just on the main domain (but not on the subdomain) can cause this problem?

do I need to activate the SSL on the staging as well to fix this problem?
Is there anything that I need to be aware of before activating the SSL on the staging as a subdomain?
will I have problems with the SSL if staging is a subdomain?

thanks in advance for your help!

I think Trellis defaults to setting HSTS to true, so now that you’ve all subdomains would need to be served via https also.

Unless there’s a good reason not to, I’d try setting up your subdomain with SSL as well - so both your wordpress_sites.yml will have:

      enabled: true
      provider: letsencrypt

thanks @ng3 for your reply.

I can try this and then I guess I need to re-provisioning the staging server, is it correct?

are you 100% sure that this action won’t impact the production server? (i would like to avoid downtime with the live website)

the main question is: is it possible to have an SLL activated on a staging server (as subdomain) and a production server?

My staging and production are on different servers with different IP.


I’m not taking any responsibility for your production server I’m afraid. It’s certainly possible to put a certificate on your staging site without affecting a completely different server.

Yes. They are two different certificates on two different servers.

thanks @ng3, sorry I didn’t intend to give to you the responsibility of my production server, I am sorry if it seemed like this, it was not my intention :cry:

the weird thing is that this problem happens randomly, sometimes works and sometimes redirect to https.

btw, I followed your suggestion, I activated the ssl for the staging as well, and now seems ok.

ha ha, no worries! Glad it’s all working for you now