If your site runs behind Nginx, you can serve a blog at yourdomain.com/blog with two location blocks. Nginx forwards every /blog request to your Rankwise blog as a reverse proxy. Readers and search engines see your address, and the rest of your site does not change.
This guide covers:
- What you need
- Step 1: Create the blog in Rankwise
- Step 2: Add the location blocks
- Step 3: Test and reload Nginx
- Step 4: Check the blog
- Troubleshooting
You need shell access to the server and permission to reload Nginx.
What you need
- A Rankwise account. The free blog is enough. It covers 10,000 visits a month.
- Nginx in front of your site, with HTTPS already set up for yourdomain.com.
- Outbound HTTPS from the server to rankwiseblog.com.
- A free path. Your site must not already use /blog. This guide uses /blog.
Step 1: Create the blog in Rankwise
- Sign up for Rankwise. On the free blog page, choose Put it on my own domain at /blog instead.
- Open the setup for the blog. Choose On my own site.
- Choose A path, like /blog.
- Enter the blog name, one line about the blog, your website (for example https://yourdomain.com) and the path, for example /blog.
- Click Create my blog.
- Rankwise shows three snippets. Pick Nginx and copy it.
The snippet holds your blog's token. Rankwise shows the token only once, so copy the whole snippet before you leave the page.
This guide covers a blog at a path. To put the blog on a subdomain like blog.yourdomain.com, choose A subdomain, like blog.yourdomain.com instead. The snippet then forwards every path on that host, so copy it from the app rather than from this page.
Step 2: Add the location blocks
Open the Nginx config file for your site and find the server { } block that serves yourdomain.com over HTTPS. Paste the snippet inside it. The snippet looks like this, with your own blog id and token:
# Inside your server { } block.
location = /blog {
return 301 /blog/;
}
location /blog/ {
proxy_pass https://rankwiseblog.com/hosted/YOUR-BLOG-ID/;
proxy_set_header Host rankwiseblog.com;
proxy_set_header x-rankwise-blog-token "YOUR-TOKEN";
proxy_set_header x-rankwise-forwarded-host $host;
proxy_set_header x-rankwise-visitor-ip $remote_addr;
proxy_ssl_server_name on;
}
Here is what each line does:
location = /blogsends a visitor at /blog to /blog/ with a permanent redirect, so the blog has one address.proxy_passforwards every path under /blog/ to your Rankwise blog. The trailing slash on both sides maps /blog/my-post to the post on Rankwise.Host rankwiseblog.comlets our server accept the request.x-rankwise-blog-tokentells Rankwise that the request comes from your server.x-rankwise-forwarded-host $hosttells Rankwise which domain serves the blog. Nginx fills$hostwith the hostname the visitor asked for.x-rankwise-visitor-ip $remote_addrpasses the visitor's IP address, so Rankwise can limit spam sign-ups to your newsletter form.proxy_ssl_server_name onsends the hostname in the TLS handshake, which our HTTPS certificate needs.
Step 3: Test and reload Nginx
Test the config before you reload, so a typo never takes your site down:
sudo nginx -t
sudo systemctl reload nginx
If nginx -t reports an error, fix the line it names and test again. Use the reload command your system uses, if it does not run systemd.
Step 4: Check the blog
- Open yourdomain.com/blog. Nginx redirects you to yourdomain.com/blog/ and shows your blog's index page.
- Back in Rankwise, click Check my blog. When Rankwise finds the blog on your page, it shows as connected.
- Open yourdomain.com/blog/llms.txt and yourdomain.com/blog/sitemap.xml. Both list your posts once you publish one.
To check that search engines may index the blog, run:
curl -sI https://yourdomain.com/blog/
The answer must not contain x-robots-tag: noindex. Rankwise sends that header when the token or the host does not match, so the copy on our server never competes with yours.
Troubleshooting
Nginx returns 502 Bad Gateway. The server cannot reach rankwiseblog.com over HTTPS. Check the server's outbound firewall and DNS, and confirm that proxy_ssl_server_name on; is in the block.
The page loads, but the header says noindex. The token or the host does not match. Check that Your website in the Rankwise setup is your domain. Copy the snippet again from Rankwise and reload Nginx. If a CDN or load balancer sits in front of Nginx, make sure it passes the visitor's hostname through, because $host must be your domain. Behind a CDN, $remote_addr is the CDN's address, so the sign-up limit counts the CDN. Nginx's real_ip module can restore the visitor's address.
My site already has a location / block that catches everything. Nginx picks the longest matching prefix, so location /blog/ wins over location /. A regex location, such as one for .php files, can still catch a blog path, so check those too. Put the blog blocks in the same server block as your site.
Check my blog fails. Confirm that yourdomain.com/blog/ shows the blog, wait a minute, and try again.
Once the blog is live, every post you publish appears at yourdomain.com/blog with its sitemap entry, RSS item, llms.txt line and Markdown copy.