Running Ubuntu 16.04 LTS 32bit, server is Nginx
I’m looking at the networking tab for my droplet and i added the following:
Type: CNAME Hostname: m.mysite.com Value: mysite.com TTL: 43200
I don’t want the mobile version to be the same as the desktop version. I have two seperate index.html files. How do i point the m.mysite.com to load the mobile version? 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!
Accepted Answer
You need to setup two different virtual hosts in Nginx, in one of them the server_name must be mysite.com and points to the directory where index.html for the desktop site is located use root directive for this.
And the other virtual host should have m.mysite.com in its server_name and its root directive should point to the other directory where the other index.html is located.
Check this for more information about how to setup nginx virtual hosts.
Hope this helps you.
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.