I have a Laravel web app running with no issues here in my DO droplet, but i want to add a subdomain (I.e example.reservate.co) to a URL generated by the Laravel app (Is not a server folder). Is that possible? How do i do that.
Thanks!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
i want to add a subdomain […] to a URL generated by the Laravel app (Is not a server folder)
I’m not sure I understand what that means—will the same Laravel app work correctly if it is accessed through the new subdomain (i.e. Sub-Domain Routing)?
If so, all you need to do is add DNS record to map the subdomain to your Droplet’s IP address and configure your webserver to serve the same app on the subdomain.
First, add a CNAME record that points to @ which is the root domain (reservate.co):
example CNAME @
Then, edit your nginx configuration adding the new subdomain to your existing server block:
server {
[...]
server_name reservate.co www.reservate.co example.reservate.co;
[...]
}
Finally, restart nginx so that the changes take effect:
sudo service nginx restart
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.