I'm trying to setup a new server that has both a live domain and a staging domain so I created a new Digital Ocean server, deleted the default site, added the production domain as a site and the staging domain which I'd like to be staging.example.com.
Then I added an A record pointing to the new server IP address. When I open terminal and run dig on the staging domain it's getting an answer back from the new server IP address but if I visit the url in the browser I get an "ERR_CONNECTION_TIMED_OUT" error.
I even tried setting up another testing subdomain with another domain on another server in forge and I'm having the same results.
When you created your site through Forge did you select the "Allow Wildcard Sub-Domains" checkbox in the "New Site" form?
This checkbox tells forge to configure Nginx to accept any subdomains and send the requests to the Laravel application.
You'll still need to configure the CNAME records on your DNS provider to point o your server's IP.
I am not an expert on nginx configuration, but have used this option with success in projects that have subdomains.
I don't know how to add this option if you created your site without selecting this checkbox. If you can recreate your site through Forge, it might help.
@rodrigo.pedra I didn't check the 'Allow wildcard sub-domains" at time of creation but I believe that I haven't done on other servers and there was no issue. Besides, I setup a second subdomain on this same server to another domain that I own with no issue at all.
Maybe I just need to destroy the server and start over?
Go to the "Sites" dropdown menu on the navbar and select the site you want to remove
After navigation scroll to the bottom an click the "delete" button and confirm
Repeat for each subdomain (if you intend all subdomains to be handled by the same Laravel app)
After that go to the servers dropdown menu, select your server and add a new site checking that option.
Of course, if you tweaked a lot of nginx files and are not sure if you messed up something you can recreate the server. But recreating only the sites is faster than provisioning a new server.
so you can't just check the option for "Allow Wildcard Sub-Domains" if the site was already created? one would need to re-create the site? is this the only way? when i created mine i did not checked this box.