Home » Nginx Hosting » How to Host Ghost on a Nginx Subdomain

How to Host Ghost on a Nginx Subdomain

Nginx Hosting

Nginx is a proxy server that was released back in 2004 on October 4th. The server is made to serve for HTTP; HTTPS; SMTP; POP3 and IMAP protocols.

The Nginx project has started with a high level of performance and low usage of memory. Although Nginx is licensed 2 – clause BSD it can also work on Linux; ATX; Mac OS X; Solaris and Microsoft Windows.

Now that we have given you a little information about Nginx, let’s say you have a website that is running on it. And you wish to install Ghost on it’s subdomain, but don’t know how.

If that is the case then you are at the right place. Our small tutorial on “How to Host Ghost on a Nginx Subdomain” will walk you step by step through the process of hosting it.

First: Find the location of Nginx on your site – /usr/share/nginx/html

Now after you found Nginx on your website, go to the directory and make a primary website – /usr/share/nginx/html/example.com and the Ghost blog in /usr/share/nginx/html/blog.example.com

To let Nginx know about your new blog we need to edit the default.conf file of Nginx
To do that you need to again find the location of the file – /etc/nginx/conf.d/default.conf

Edit that file:

Sudo vi /etc/nginx/conf.d/default.conf Then at the bottom of it enter the following (changing the server_name to your site)

#Following section for blog.example.com
server {
listen 80;
server_name blog.example.com;

location / {
proxy_pass ;
proxy_set_header Host $host;
proxy_buffering off;


To save the changes you need to restart Nginx – sudo service nginx restart

We are just one step away from hosting Ghost on a Nginx subdomain – Restart your browser

We hope our small tutorial was helpful. Stay tuned to the blog for more tutorials and interesting articles.

Leave a Reply

Your email address will not be published. Required fields are marked *