Why a Blog Subdirectory Setup Matters
You’ve got a killer Shopify or main site. Now you want a blog. Not on a subdomain, but in /blog. It keeps all your SEO juice in one place. That’s the beauty of a blog subdirectory setup:
- Shared domain authority.
- Smoother link flow.
- Better user trust.
But it feels… tricky. Nginx. Reverse proxy. Bot detection. SSL certificates. Where to begin?
Let’s break it down. Step by step.
Understanding Nginx Reverse Proxy Basics
A reverse proxy sits in front of your servers. It accepts requests on your domain, talks to internal services, and returns responses. Simple.
Core Concepts
-
Upstream
Defines your blog backend. -
Server Block
Listens on port 80/443 forexample.com. -
Location
Matches/blogand shunts it to the blog server.
Example Nginx snippet:
upstream blog_backend {
server 127.0.0.1:2368; # Your blog engine (Ghost, WordPress, etc.)
}
server {
listen 80;
server_name example.com www.example.com;
location /blog/ {
proxy_pass http://blog_backend/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
# Other server blocks...
}
That is the heart of your blog subdirectory setup. But we’re not done.
Step-By-Step Guide to Your Blog Subdirectory Setup
Let’s walk through a practical plan.
1. Spin Up Your Blog Engine
Pick a CMS. Ghost. WordPress. Or a custom Node.js app.
- Install on its own server or container.
- Run on port 2368 (Ghost) or 8080 (WordPress dev).
- Verify you can reach it via
blog.internal.local.
2. Configure Nginx as Reverse Proxy
On your main server:
- Install Nginx:
sudo apt update && sudo apt install nginx - Create a new site file:
/etc/nginx/sites-available/blog-proxy.conf - Add the upstream and server blocks (see above).
- Enable and test:
bash
ln -s /etc/nginx/sites-available/blog-proxy.conf /etc/nginx/sites-enabled/
nginx -t && systemctl reload nginx - Visit
example.com/blog/. Fancy that.
3. Handle SSL Certificates
You want HTTPS everywhere. There are two routes:
- Let’s Encrypt on Nginx
Terminate SSL here. - End-to-End SSL
SSL on Nginx, plus SSL on blog backend.
For most, Nginx termination is enough. Use Certbot:
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d example.com -d www.example.com
Boom. Secure.
4. Tackle Bot Detection
Shopify’s forum reveals that pure Nginx proxies can trigger bot blocks. Users turned to AWS CloudFront to sneak traffic through. They set up behaviours for /blog/* and default to Shopify. Works, but feels complex.
Your blog subdirectory setup can avoid this if:
- You serve everything over a real domain.
- You preserve the
Hostheader. - You add the
X-Forwarded-Forheader.
In short: mimic a real user. And you’ll dodge most bot filters.
Automate AI Blog Publishing with CMO.so
So you’ve got a reverse proxy. Now fill /blog with content. Manually? Over. It’s 2025.
Meet Maggie’s AutoBlog from CMO.so. It:
- Auto-generates microblogs (up to 4,000 per month!).
- Tunes each post for SEO and GEO.
- Filters out low performers.
- Publishes straight to your CMS via API.
No more staring at a blank editor. Just set your topics, let AI do the rest, and watch traffic grow.
Fine-Tuning Performance & Caching
A solid blog subdirectory setup needs speed.
Caching on Nginx
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=blogcache:10m max_size=1g inactive=60m use_temp_path=off;
location /blog/ {
proxy_cache blogcache;
proxy_cache_valid 200 302 10m;
proxy_cache_valid 404 1m;
proxy_pass http://blog_backend/;
# headers...
}
- Reduces load on your blog engine.
- Speeds up repeat visits.
Purge Strategy
When Maggie’s AutoBlog pushes a new post, clear the cache:
curl -X PURGE https://example.com/blog/new-post-url
Combine with webhooks for zero-lag updates.
SEO Tips for Your Subdirectory Blog
You’re here for traffic. Follow these quick wins:
- Use proper
<link rel="canonical">. - Generate an XML sitemap for
/blog/*. - Set meta titles and descriptions via Maggie’s AutoBlog settings.
- Leverage internal linking between main site and blog.
By hosting in a blog subdirectory setup, every share and inbound link helps your main domain. Nice.
Common Pitfalls & How to Avoid Them
Let’s learn from others:
- CloudFront setups can yield 403 or 502 errors if mis-configured.
- SSL renewal might fail if you proxy the homepage too aggressively.
- Shopify’s anti-bot can still block CloudFront IPs if you skip header config.
The trick? Keep it simple. One proxy. One certificate. Proper headers.
Why Nginx + CMO.so Beats the Rest
You might have seen competitors like CloudFront hacks or other AI tools. They work… up to a point:
- CloudFront: extra cost. Complex behaviours.
- Jarvis.AI and Writesonic: need manual prompts.
- Blogely: planning only.
Maggie’s AutoBlog nails it:
- Zero-code integration.
- Fully automated workflows.
- Performance analytics built in.
All inside a blog subdirectory setup that’s native to your site. No subdomains. No workarounds.
Ready to Scale Your Subdirectory Blog?
You’ve got the blueprint. Nginx reverse proxy? Check. SEO perks? Check. Automated AI content? Check.
Time to turn theory into results. Get started today.