How to install Jekyll + nginx + Ubuntu + subdomain of godday

I used the following for :

Let’s say you have a site hosted in aws EC2 with IP: exampleIP


For Goddady stuff go here  and following values.

  • Host – blog
  • Points to – exampleIP or the new IP
  • TTL – 600


Ngnix Conf:

Write the following conf to /etc/nginx/sites-enabled/example_blog_conf

server { 


 access_log /var/log/nginx/blog.example.log;

 location / {
 proxy_set_header X-Real-IP $remote_addr;
 proxy_set_header HOST $http_host;
 proxy_set_header X-NginX-Proxy true;

 proxy_redirect off;
$ sudo service nginx restart

Jekyll setup

$jekyll new blog
$ sudo apt-get install ruby-full
$ curl -sSL | bash -s stable --ruby
$ source /home/ubuntu/.rvm/scripts/rvm
$ rvm install ruby --latest
$ rvm use ruby --latest
$ gem install jekyll bundler
$ jekyll new blog
$ bundle install


Update: blog/_config.yml

description: > # this means to ignore newlines until "baseurl:"
 I have an awesome new Example blog
baseurl: "" # the subpath of your site, e.g. /blog
url: "" 
twitter_username: jekyllrb
github_username: jekyll
# Build settings
markdown: kramdown
theme: minima
 - jekyll-feed
 - Gemfile
 - Gemfile.lock
$ jekyll serve


Boto3: Upload a file to s3

Create an IAM role for s3 and attach the role to the EC2 instance.

import boto3
import sys
import os
from datetime import datetime
import traceback

bucket_name = 'some-bucket'
file_to_upload = "/path/to/file"
file_name = 'file'

try :
  s3 = boto3.resource('s3')
  bucket = s3.Bucket(bucket_name)
  bucket.upload_file(file_to_upload, file_name)
  print( "{} copied to {}".format( file_to_upload, bucket ) )
except Exception as err:
  # time is always in GMT 
  print ('%Y-%m-%d %H:%M:%S'))