Splitting your stack across three vendors is great for portability until you spend an afternoon chasing an SSL mismatch or an infinite 301 redirect loop. I run my domains through Namecheap, deploy Node backends to Hostinger, and push traffic through StackPath CDN for edge caching. If one service hiccups or I migrate hosts down the road, Namecheap and StackPath stay right where they are. Here is how to wire them up without breaking SSL or caching stale pages.

1. Prep the Hostinger Origin Server
Before throwing a CDN in front of anything, make sure your app works directly on the origin. If you run a Node or Express app on Hostinger, it needs to boot cleanly on its local port behind Hostinger’s internal reverse proxy.
Here is the lightweight Express script I used to test incoming headers, IP passthrough, and edge latency:
const express = require('express');
const app = express();
const PORT = process.env.PORT || 3000; app.use(express.static('public', { maxAge: '1d', setHeaders: (res, path) => { res.setHeader('Cache-Control', 'public, max-age=86400, stale-while-revalidate=3600'); }
})); app.get('/api/health', (req, res) => { res.json({ status: 'ok', timestamp: Date.now(), hostHeader: req.get('host'), clientIp: req.headers['x-forwarded-for'] || req.socket.remoteAddress });
}); app.listen(PORT, () => { console.log(`Origin application listening on port ${PORT}`);
});If you haven’t wired up your server environment yet, follow this guide on how to deploy a Node.js app on Hostinger with production environment variables. Grab your Hostinger shared IP address (or VPS IPv4) from hPanel under Server Details. Keep that IP handy—StackPath needs it as the origin target.
2. Configure Hostinger Origin SSL
This is where people usually hit their first wall: edge-to-origin encryption. When StackPath pulls assets from Hostinger over port 443, Hostinger has to present a valid SSL certificate. But because Namecheap handles your DNS (and will soon point to StackPath), hPanel’s automated Let’s Encrypt bot can’t complete the HTTP-01 challenge.
To get around this, install a self-signed or wildcard cert in hPanel, or temporarily point your domain’s A record straight at Hostinger’s IP until Let’s Encrypt finishes issuing. Once it is active, test it directly via curl:
# Verify Hostinger answers over TLS using its direct IP and SNI
curl -Iv --resolve app.example.com:443:195.179.236.42 https://app.example.com/api/healthMake sure you see an HTTP 200 before touching CDN settings. If you get a certificate verification error here, StackPath won’t talk to your origin either.
3. Create the StackPath Edge Site
Log in to StackPath and create a new CDN Site with your domain name (like app.example.com or example.com).
- Set Origin Type to IP Address.
- Enter your Hostinger origin IP.
- Set the Origin Port to
443. - Under Origin Connection Security, choose End-to-End (HTTPS to Origin).
Do not fall back to plain HTTP on port 80. If Hostinger has an automatic HTTPS redirect rule enabled, StackPath will pull an HTTP 301 on every single cache miss, throwing your users straight into an infinite redirect loop.
Also, check the Host Header in StackPath’s Origin Settings. By default, StackPath passes the incoming client host header, which works fine. But if you accidentally override it with the raw origin IP, Hostinger won’t know which virtual host you want and will just throw its default landing page.
4. Add Edge Caching Rules and Cookie Stripping
Dynamic apps love setting session cookies, and those cookies kill edge cache hit rates. You want your API endpoints to fetch dynamically, while static assets live on StackPath’s edge servers.
Head to EdgeRules in StackPath and create a rule for static assets:
- If: URL matches
/static/*or file extensions like.(css|js|png|jpg|svg|woff2) - Then: Override Cache TTL to 7 days, and strip response cookies.
Leaving cookies attached on assets often forces cache misses. Here is a detailed walkthrough on how to strip Set-Cookie headers for static assets in StackPath. If you load custom web fonts from the CDN, you will also want to review how to fix CORS font loading errors on CDN with Nginx header rules so browsers don’t block them.
Check the MDN Web Docs on Cache-Control to make sure your origin app sends headers that CDN proxies respect.
5. Route Traffic Using Namecheap DNS
After StackPath finishes pushing your site config to its edge, it gives you an Anycast edge target—either a CNAME host like edge.stackpathcdn.com or a pair of Anycast IPv4 addresses.
Jump into Namecheap, open your Domain List, click Manage, and head to Advanced DNS. For an in-depth breakdown of this step, read our guide on how to connect Namecheap DNS to StackPath CDN with Hostinger origin.
Add your records:
- CNAME Record: Host:
app| Value:your-site-id.stackpathcdn.com.| TTL:5 min(keep it short while testing). - Apex Domains: If you are setting up the root domain (
example.com), Namecheap won’t let you CNAME the apex. Use StackPath’s Anycast A records instead: Host:@| Value:151.139.128.10(use your actual assigned StackPath IPs).
Check the Namecheap Advanced DNS documentation if you hit record type restrictions.
Verify propagation from your terminal:
dig +short CNAME app.example.com
dig +short app.example.com @8.8.8.8The answer section should return StackPath’s Anycast IPs, not Hostinger’s origin.
6. Set Up StackPath Edge SSL
Now that DNS sends traffic to StackPath, users terminate their TLS handshake at StackPath’s edge before requests ever touch Hostinger. You need an SSL cert on the edge.
Go to EdgeSSL in the StackPath dashboard and hit Generate Free Certificate. StackPath will issue a free Let’s Encrypt cert. Since Namecheap DNS already points to StackPath, the HTTP-01 challenge validates in about 30 seconds.
Verify the TLS handshake from the terminal:
echo | openssl s_client -servername app.example.com -connect app.example.com:443 2>/dev/null | openssl x509 -noout -issuer -datesThe issuer should show Let’s Encrypt (or StackPath SSL). That means clients talk securely to the CDN, and the CDN connects securely to Hostinger.
7. Test Edge Hit Rates and Verify Latency
Let’s confirm the split: dynamic routes should pass through to Hostinger, while static assets should cache at StackPath. First, hit your dynamic API route:
curl -IXGET https://app.example.com/api/healthYou should get response headers like this:
HTTP/2 200 server: StackPath
date: Wed, 18 Oct 2023 14:22:01 GMT
content-type: application/json; charset=utf-8
x-cache: MISS
x-handled-by: originNow pull a static asset twice:
curl -IXGET https://app.example.com/static/bundle.js
curl -IXGET https://app.example.com/static/bundle.jsOn that second run, check the cache status header:
HTTP/2 200 server: StackPath
date: Wed, 18 Oct 2023 14:22:15 GMT
content-type: application/javascript
cache-control: public, max-age=86400, stale-while-revalidate=3600
x-cache: HIT
age: 14In my testing from an off-region VPS, dynamic hits through to Hostinger clocked around 380ms. The second fetch on the static bundle dropped to 22ms straight from StackPath’s edge pop.
8. Troubleshooting Common Edge Errors
I hit both of these while putting this exact setup together:
- 502 Bad Gateway: StackPath can’t finish the TLS handshake with Hostinger. Check that Hostinger has a valid cert installed for the exact domain configured in your StackPath origin settings. You can switch the origin connection to HTTP (port 80) for two minutes just to confirm the app itself isn’t crashing, then switch it back once the cert is fixed.
- Too Many Redirects (ERR_TOO_MANY_REDIRECTS): If Hostinger forces HTTPS redirects while StackPath talks to it over HTTP (port 80), StackPath asks for HTTP, Hostinger sends back a 301, and StackPath hands that 301 right back to the browser. Keep port 443 configured across both ends.
Frequently Asked Questions
Can I point Namecheap nameservers directly to StackPath?
No. StackPath is an Anycast CDN proxy, not an authoritative nameserver. Keep your nameservers on Namecheap BasicDNS or PremiumDNS, then route your specific subdomains or apex records to StackPath via CNAME or A records.
Why does my web app report the StackPath IP instead of the user IP?
Because StackPath proxies the connection, Hostinger sees the incoming request coming from StackPath’s edge servers. In Express or whatever framework you use, enable proxy trust (like app.set('trust proxy', true)) and pull the client’s real IP from the X-Forwarded-For header. Check the Node.js HTTP documentation for details on handling proxy headers.
What happens if Hostinger changes my shared origin IP?
If you are on a shared Hostinger plan, they occasionally migrate accounts to new servers, which changes your origin IP. When that happens, your site will go down until you update the origin IP in StackPath’s Site Settings. Your Namecheap DNS stays completely untouched because it points to StackPath, not Hostinger.
Once you have this pipeline running, lock down your cache headers. Take a look at our guide on Nginx Cache-Control Immutable static asset caching to squeeze even faster load times out of your Hostinger origin.

