Subdomains on Ubuntu LTS 12.04 with ngnix and ghost

June 17, 2014 1.1k views
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 my ghost blog would load. Now I wanna make some changes, I would like to have a subdomain for example: that points to my ghost blog and leave a static html(or another type of content) to I'm trying to follow this tutorial: 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!
2 Answers
Your DNS settings look fine. Now it's a matter of getting your Nginx configuration right. You need to use the server_name directive. So your conf might look something like:
server {
    listen 80;
    server_name ;

    client_max_body_size 10M;

    location / {
            proxy_pass http://localhost:2368/;
            proxy_set_header Host $host;
            proxy_buffering off;
server {
        listen   80;

        root /var/www/;
        index index.html index.htm;
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
Have another answer? Share your knowledge.