How to Host your Own Videos Alongside Ghost

Post cover image

Have a Ghost blog and want to embed some videos? Don't want to upload the video to YouTube or Vimeo? Why not self host them on your VPS alongside Ghost? This post will describe how you can configure Nginx to host Ghost and your videos.

In your main Nginx configuration file add the following alongside your Ghost proxy:

 location ^~ /videos {
    root /var/www;

So that it looks similar to this:

server {
    listen 80;
    client_max_body_size 10G;

    location / {

        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_buffering off;

    location ^~ /videos {
        root /var/www;


Now add videos to /var/www/videos/ and make sure they are accessible by the Nginx user:

 chown -R nginx:nginx /var/www/videos/

Now in your Ghost post you can add the following:

<video src="" controls></video>

Once you change to your actual file you will see the movie embedded in your Ghost post