nginx guide

How to serve a blog at /blog with nginx

Running your own server? Two nginx location blocks are enough to serve a free Outrank blog at yourbrand.com/blog, next to your app, on the same domain.

Create my free blog

Free with Outrank Blogs. No credit card needed. See what is included

Subfolder

Your blog at yourbrand.com/blog

nginx proxies every request under /blog to your Outrank blog. Your app keeps serving everything else.

Step by step

Set up your blog on nginx

  1. 1Create your free blog: enter your website and pick a template. It is live in about a minute.Start here
  2. 2In Outrank, open Blog → Settings → Domain and choose “Subfolder”. Enter your website address, such as yourbrand.com, keep the path /blog and click Continue. Outrank shows the code for your setup with your blog’s address already filled in.
  3. 3Add these location blocks inside the server block of your site.
  4. 4Test the configuration with nginx -t, reload nginx, then click Check now in Outrank.
  5. 5Add a “Blog” link to your site’s header or footer that points to /blog.
nginx.conf
location = /blog {
  proxy_pass https://o--your-blog-id.outrankblog.com/;
  proxy_set_header Host o--your-blog-id.outrankblog.com;
  proxy_set_header X-Forwarded-Host $host;
  proxy_set_header X-Forwarded-Proto $scheme;
  proxy_ssl_server_name on;
}

location /blog/ {
  proxy_pass https://o--your-blog-id.outrankblog.com/;
  proxy_set_header Host o--your-blog-id.outrankblog.com;
  proxy_set_header X-Forwarded-Host $host;
  proxy_set_header X-Forwarded-Proto $scheme;
  proxy_ssl_server_name on;
}

Example only. In your dashboard, Outrank shows this code with your blog’s own address filled in.

Tips for nginx

  • Keep proxy_ssl_server_name on: the blog is served over HTTPS and needs the right server name.
  • Behind a load balancer or CDN, make sure /blog requests reach nginx and are not cached by another rule first.

Want the posts written for you?

Outrank can research keywords and publish 30 SEO articles a month to your blog, on autopilot.

See plans

FAQ

Adding a blog to nginx: questions

Short answers to what people ask most.

Why put the blog in a subfolder instead of a subdomain?
Search engines treat yourbrand.com/blog as part of your main website, so every post builds the authority of the domain your product pages are on. A subdomain like blog.yourbrand.com works too and is quicker to set up, but it is treated more like a separate site.
Can I do the same with Apache or Caddy?
Yes. Any reverse proxy works: forward /blog and /blog/* to your blog’s address shown in Outrank, and pass the X-Forwarded-Host and X-Forwarded-Proto headers.
Does connecting my own domain cost anything?
No. Connecting a subdomain, a subfolder or a separate domain is free on every Outrank Blogs plan, and HTTPS is included.

Start today

Your blog can be live before your coffee gets cold.