Point Shared Hosting Domain to VPS: The Correct A Record & Proxy Setup
Here is a common scenario: You bought a cheap domain + hosting bundle (Shared Hosting/cPanel). Later, you bought a powerful VPS (AlmaLinux/Ubuntu) for your apps.
Now, you want app.yourdomain.com to point to your VPS, while the main website stays on Shared Hosting. Or maybe you want to hide your VPS IP.
In this guide, I will show you how to bridge your Shared Hosting Domain to your Private Server.
Method 1: The "A Record" Pointing (Easiest)
This is the standard way. You tell the DNS system: "If anyone asks for subdomain, send them to this IP Address."
- Login to your cPanel or Domain Manager.
- Look for Zone Editor or DNS Management.
- Click + A Record.
- Name:
app(This creates app.yourdomain.com) - Address/Value:
123.45.67.89(Your VPS Public IP). - Save. Wait 10-30 minutes for propagation.
Method 2: Reverse Proxy (The "Stealth" Mode)
If you don't want to expose your VPS IP directly, you can set up a Reverse Proxy on your server using Nginx. This handles the traffic coming from the domain.
Ask AI to generate the config:
"Generate an Nginx Server Block configuration.
Domain: app.dailyinnovatetech.com
Proxy Pass: http://localhost:8080 (Where your Python/Node app runs).
Include standard headers for WebSocket support."
The AI Result:
server {
listen 80;
server_name app.dailyinnovatetech.com;
location / {
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
Common Pitfall: The "Shared Hosting" Proxy
Some people try to use their Shared Hosting script (PHP) to proxy traffic to the VPS to hide the IP.
Warning: Don't do this. Shared hosting providers will ban you for high resource usage (cURL loop). Stick to DNS pointing (Method 1) or Cloudflare.
Conclusion
Your domain and your server don't have to live in the same place. By mastering DNS Records, you can host your email on cPanel but run your heavy Python apps on a separate VPS seamlessly.
Author: Marg | Daily Innovate Tech

Post a Comment for "Point Shared Hosting Domain to VPS: The Correct A Record & Proxy Setup"