Graham Stevens
⟵ Home

Tumblr as a Subdirectory (On Nginx)

Tumblr will let you run a blog as a sub-domain (blog.domain.com) rather than using their own URL scheme (username.tumblr.com), allowing your blog to appear much more professional and appear directly linked to your domain/website.

However, it is argued within the SEO scene that a subdomain is bad practice for maximising your search engine optimisation. This is because subdomains do not always receive the benefits from the root domain they’re on. For example, just because tumblr.com is a highly ranked domain, does not mean that this ranking will affect deadblog.tumblr.com or john doe.tumblr.com.

Subdirectories, on the other hand, get all the benefits from its associated domain, as it is considered a continuation of the original root website e.g. dell.com & dell.com/shop.

Further details can be found on this great post at The Moz.

So after all of this, you want to run your tumblr on your domain as a subdirectory:

server {
        listen          80;
        server_name     yourdomain.com;

        access_log      /var/log/nginx/access.log;

        proxy_set_header  X-Real-IP       $remote_addr;
        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header  Host            $http_host;
        proxy_set_header  REMOTE-HOST     $remote_addr;
        proxy_redirect    off;
        proxy_max_temp_file_size          0;
		
        location /blog/ {
                proxy_pass http://username.tumblr.com;
                break;
        }
}
	
server {
        listen          80;
        server_name     www.yourdomain.com;
        rewrite ^/(.*)  http://yourdomain.com/$1 permanent;
}

What this configuration allows is any access to yourdomain.com/blog/ is passed through a proxy to your Tumblr blog, including the URL scheme. It will also redirect any access to www.yourdomain.com to http://yourdomain.com.

Hope this helps!


$ whoami I am Graham Stevens, a Cyber Security Specialist based in the South West of the UK. If you're lucky, I very occasionally post updates on Twitter/Mastodon.