A site hitting 900ms server response times on standard shared hosting feels sluggish to global visitors. Moving your static assets or full site proxy through an edge network drops that latency to double digits, but wiring the pieces together often leads to redirect loops or broken SSL certificates.
I run this exact infrastructure for high-traffic projects: Namecheap manages the zone, StackPath handles edge caching and SSL termination, and a Hostinger instance acts as the protected origin server. Here is how to configure each layer without dropping a single packet.

The Core Architecture: How Traffic Flows
Before touching your registrar or web host dashboard, you need to understand the path a browser request takes. A misconfigured header or missing Host directive will cause an immediate HTTP 520 or SSL handshake timeout.
When a visitor types your domain into their browser:
- The browser queries Namecheap DNS resolvers for your domain’s records.
- Namecheap returns a CNAME pointing to your unique StackPath edge address (for example,
c.stackpathcdn.com). - StackPath terminates the public SSL connection at the nearest edge point of presence (PoP).
- If the requested asset is in cache, StackPath returns it in under 30ms.
- If it is a cache miss or dynamic request, StackPath forwards the request to your Hostinger origin IP address.
- Hostinger processes the request and sends the response back to StackPath, which serves and optionally caches it.
To avoid infinite redirect loops, both the edge CDN and Hostinger must understand the primary domain identity via the HTTP Host header. Let us grab the origin values first.
Step 1: Extract Your Hostinger Server IP and Vhost Details
You cannot point StackPath to your domain name directly because your domain will soon resolve to StackPath itself. You must point StackPath to the raw dedicated or shared IP address assigned by Hostinger.
Log in to your Hostinger hPanel and find your server details:
- Navigate to Websites and click Manage next to your target domain.
- Look at the left sidebar under Hosting Details.
- Copy the Server IP (an IPv4 address like
185.193.126.44). - Confirm that your site already loads directly over HTTPS with a free Let’s Encrypt certificate installed in hPanel.
If you are deploying dynamic applications, such as running a Node.js app on Hostinger with production environment variables, ensure your PM2 daemon and local reverse proxy listen properly on the internal port before exposing it.
Test direct origin reachability from your local terminal using curl to verify your server responds to your domain header:
curl -Iv -k --resolve example.com:443:185.193.126.44 https://example.comIf you get an HTTP/2 200 or HTTP/1.1 200 OK response, Hostinger’s virtual host is ready to accept forwarded traffic from that IP.
Step 2: Create the StackPath CDN Site and Configure Origin
Now, jump into your StackPath console. We need to create a CDN site that accepts incoming traffic for your domain and pulls uncached data from Hostinger.
- From the StackPath dashboard, select CDN and click Create Site.
- Select CDN Service (or CDN + WAF if you need edge filtering).
- Enter your site domain name (for example,
example.comorwww.example.com). - Under Origin Type, select IP Address.
- Paste your Hostinger server IP address into the origin field.
- Set the Origin Port to
443for secure communication between StackPath and Hostinger.
Once created, click into your new site and head to the Edge Rules and Origins configuration tabs. Check the Host Header setting. By default, some configurations set this to the origin IP, which breaks Hostinger’s Apache/Nginx reverse proxy. Switch it to Match Incoming Host Header so Hostinger receives example.com instead of the numeric IP.
For optimal asset handling, you should also strip Set-Cookie headers for static assets in StackPath. Unnecessary cookies prevent intermediate caches from serving static files efficiently.
Step 3: Issue and Verify Edge SSL Certificates on StackPath
Do not switch DNS until your CDN has a valid SSL certificate deployed. If you repoint Namecheap DNS before the CDN cert is ready, every visitor gets a browser privacy warning.
StackPath supports automated Let’s Encrypt edge certificates:
- Navigate to Certificates inside the StackPath site settings.
- Click Generate Certificate.
- StackPath will generate verification records (either an HTTP verification challenge or a TXT DNS record).
- If you have not repointed DNS yet, choose DNS verification.
Take the TXT record name (usually _acme-challenge.example.com) and the hash string provided by StackPath. We will place this directly into Namecheap in the next step to validate your edge SSL certificate before going live.
Step 4: Configure DNS Records in Namecheap
Log in to your Namecheap dashboard. Go to your Domain List, find your domain, and click Manage. Next, select the Advanced DNS tab.
First, verify your edge certificate if you chose the TXT verification method in the previous step. Add a new record:
- Type: TXT Record
- Host:
_acme-challenge(or the exact subdomain requested by StackPath) - Value: Paste the verification hash from StackPath
- TTL: Automatic or 1 min
Wait 2 to 3 minutes, then head back to StackPath and click Verify. Once the edge SSL status turns to active green, update your primary routing records in Namecheap.
Find your unique StackPath CDN Delivery Address on your StackPath dashboard overview. It looks like stackpathdns.net or a custom endpoint like alias.stackpathcdn.com.
In Namecheap Advanced DNS, set up the records according to your domain structure:
- If routing
www.example.com:- Type: CNAME Record
- Host:
www - Value:
your-site-id.stackpathcdn.com - TTL: Automatic (or 5 minutes while testing)
- If routing the apex root domain (
example.com):- Namecheap supports an ALIAS Record or ANAME.
- Type: ALIAS Record
- Host:
@ - Value:
your-site-id.stackpathcdn.com - TTL: Automatic
Remove any existing A Records pointing directly to Hostinger’s IP address for the hosts you just changed to StackPath. Keep MX and mail records untouched so email delivery continues without disruption, just as you would when you delegate a subdomain to external nameservers in Namecheap DNS.
Step 5: Verify DNS Propagation and Edge Routing
Once saved, check DNS propagation using dig or nslookup from your local terminal:
dig www.example.com +nostats +nocomments +nocmdYour output should show the CNAME chain leading to StackPath edge anycast nodes:
www.example.com. 300 IN CNAME your-site-id.stackpathcdn.com.
your-site-id.stackpathcdn.com. 60 IN A 151.139.128.10
your-site-id.stackpathcdn.com. 60 IN A 151.139.128.11Next, send an HTTP request to inspect the response headers returned by the CDN:
curl -I https://www.example.comLook specifically for these edge headers in the response:
HTTP/2 200
server: StackPath
x-cache: HIT
x-hw: 1681283921.d01.par1.t,1681283921.c01.par1.hThe server: StackPath and x-cache headers confirm your request hit the edge network and pulled content successfully.
Troubleshooting Common StackPath and Hostinger Gotchas
Hooking up three distinct services can surface edge cases that break functionality. Here are the three most common bugs I run into and how to solve them.
1. Hostinger Redirects All Requests to HTTPS Loop (ERR_TOO_MANY_REDIRECTS)
If StackPath connects to Hostinger over port 80 (HTTP), but Hostinger has Force HTTPS enabled in hPanel, Hostinger sends a 301 redirect back to the client. The client reconnects via StackPath over HTTPS, StackPath requests HTTP again from the origin, and the browser loops until it dies.
Fix: Inside StackPath Site Settings > Origins, toggle the Origin Protocol strictly to HTTPS (Port 443). Ensure Hostinger’s SSL is valid for that vhost.
2. WordPress Dynamic Requests and Admin Dashboard Caching
By default, aggressive CDN edge caching will cache authentication sessions or dynamic responses. If users log into your site, they might see another user’s cached profile or get blocked during POST requests.
Ensure your edge rules bypass the cache for backend routes. You can set this up by following our guide on how to bypass CDN edge cache for logged-in WordPress users, and make sure you also explicitly bypass CDN edge cache for admin-ajax.php in WordPress.
3. Restoring Real Visitor IPs in Hostinger Logs
Because StackPath acts as a reverse proxy, your Hostinger server access logs will show StackPath’s edge IP addresses instead of the real visitor’s IP. This breaks rate limiting, security plugins, and analytics.
StackPath passes the true visitor IP in the X-Forwarded-For and X-Real-IP headers. If you have root access to a VPS, you can load the Nginx real_ip module or Apache mod_remoteip. For shared Hostinger accounts, add this to your .htaccess file inside public_html:
RemoteIPHeader X-Forwarded-For RemoteIPTrustedProxy 151.139.0.0/16 RemoteIPTrustedProxy 198.252.120.0/22
This snippet instructs Apache to read the true origin address from the trusted edge subnet range without corrupting connection data.
Frequently Asked Questions
Can I use Namecheap BasicDNS or do I need PremiumDNS?
Namecheap BasicDNS works fine. BasicDNS supports CNAME records for subdomains and ALIAS records for root domains. You do not need to purchase PremiumDNS unless you specifically want secondary DNS failover or SLA guarantees.
Do I need an SSL certificate on Hostinger if StackPath provides edge SSL?
Yes. You should always run Full/Strict SSL. This means StackPath encrypts the connection between the user and the edge, and also maintains an encrypted TLS connection between the edge and your Hostinger origin. You can generate a free Let’s Encrypt certificate directly inside Hostinger hPanel for this origin link.
Why am I seeing a 502 Bad Gateway from StackPath?
A 502 error means StackPath cannot reach your Hostinger origin. Verify that the Hostinger server IP in StackPath is correct, that Hostinger’s firewall has not blacklisted StackPath’s IP range, and that your origin web server is responding over the configured port (80 or 443).
How quickly will the Namecheap to StackPath DNS switch take effect?
If you set your Namecheap TTL to 300 seconds (5 minutes) before making the change, traffic will start moving to StackPath within 5 to 15 minutes globally. Some downstream recursive resolvers ignore low TTLs and may take up to 2 hours to update.
Next Steps for Your Infrastructure
With traffic flowing from Namecheap through StackPath to Hostinger, the origin server is now shielded from direct traffic spikes and static asset load. Your next maintenance task should be tuning your static asset headers directly on the server to prevent origin fetches altogether. Read our walkthrough on configuring Nginx Cache-Control immutable headers to instruct both StackPath and client browsers to keep production assets cached indefinitely.

