So I had my droplet setup to point directly to a ghost installation I made during the configuration of the droplet. My DNS record is like this:
A @ my.ip.address CNAME * @
And the DNS records for DO
so if I went to mydomain.com my ghost blog would load.
Now I wanna make some changes, I would like to have a subdomain for example: blog.mydomain.com that points to my ghost blog and leave a static html(or another type of content) to mydomain.com
I’m trying to follow this tutorial: https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-virtual-hosts-server-blocks-on-ubuntu-12-04-lts--3
But it didn’t work, and I beleive it’s because I didn’t setup the DNS records properly and perhaps didn’t setup the permissions properly.
How can I setup a subdomain and keep my current ghost install?
Thanks for the time!
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!
Your DNS settings look fine. Now it’s a matter of getting your Nginx configuration right. You need to use the <code>server_name</code> directive. So your conf might look something like: <pre> server { listen 80; server_name blog.example.com ;
client_max_body_size 10M;
location / {
proxy_pass http://localhost:2368/;
proxy_set_header Host $host;
proxy_buffering off;
}
} server { listen 80; server_name example.com;
root /var/www/example.com/public_html;
index index.html index.htm;
} </pre> Let us know how it goes!
Thanks for the info astarr
It finally worked, I had to tinker with nginx a bit since I hadn’t used it before, your config helped me, so for anyone looking to something like this here is my config file for nginx:
And just be wary of a couple of things: -Remember to run ghost again, I stopped the service and forgot to start it again. -Restart nginx to apply any config changes
Thanks for the help
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.