The Problem
So here's a scenario I'm sure many of us are familiar with: you're working on a SaaS product, and naturally there are multiple components involved:
- a landing page, hosted somewhere like Landen, Carrd, LeadPages, etc.
- your app's frontend, hosted on a CDN like surge.sh, netlify, etc.
- your app's backend, hosted on Heroku, AWS, DigitalOcean, etc.
- a blog or support docs explaining your product
But the problem is you want all of these components to be under your domain name, myproduct.com. What do you do?
The usual solution is subdomains: have myproduct.com go to the landing page, app.myproduct.com goes to the app frontend, which talks to api.myproduct.com, blog.myproduct.com, support.myproduct.com, you get the idea.
This approach works, but it has some issues. For one, it hurts your SEO. It also requires you get wildcard SSL certificates to support HTTPS on all of these subdomains. Not to mention all of the CORS and cookie issues you'll run into.
It'd be nice if you could have myproduct.com/app, myproduct.com/api, myproduct.com/blog right? But how do you do that? What we need is a reverse proxy!
Reverse Proxy
"A reverse proxy (or gateway) appears to the client just like an ordinary web server. The client makes ordinary requests for content, and reverse proxy decides where to send those requests and returns the content." - Apache Docs
There are several options for this: HAProxy, NGINX, Apache (aka httpd), Caddy. I particularly like this guide of how to set up HAProxy with Docker and Heroku. Another good one is this guide on how to set up NGINX as a reverse proxy.
Something Better
If all of this seems like a lot of trouble, you're not alone. I thought so too, and that's why I'm making Routepath. The goal is simplicity: choose which paths go where, point your domain at routepath.app, and you're done. Some additional things Routepath will handle for you include:
- Automatic SSL cert retrieval and renewal
- Automatic redirect to HTTPS
- Middleware (CORS, Authentication, Custom Headers, etc.)
- Metrics
- And more (if you have a feature you'd find useful, let me know)
Routepath isn't launched yet, but if you're interested, you can sign up for updates and an early look by visiting routepath.app or by following @routepathapp on Twitter.
This sounds sick. How's the progress coming along and what's the timeline looking like to launch?
I'm glad you think so! :D
Things have been coming along quite nicely, but really I'm trying to take things slow and make sure I have the idea fleshed out and validated before I rush to make an MVP.
That said, I already have a decent amount of code written. If I had to give an estimate I'd say a matter of months for an MVP and beta testing before launch.
This sounds cool and something I could have used recently! Will this be globally distributed? If my servers are in Europe for a European audience and routepath is US (as an example, not sure where you are 🙂) the latency due to the inter-continental proxy would be non negligible. Maybe some geo based DNS could solve that though. Good luck!
This is something I've been keeping in mind. I'm not sure how reasonable full global distribution will be for an MVP launch, but it's definitely on the roadmap. I think a US and Europe launch might be doable though.
Does subdomain.domain really hurt your SEO?
Not really. You need to adjust your strategy to take advantage of this. For example if you build a high traffic blog with a good seo reputation with search enginers on blog.yourdomain.com and then link from the blog to your site that actually helps your sites reputation
I think it depends on your app and what kind of content you have. And maybe this has changed in the past few years, but Moz usually a pretty reliable source on the matter https://moz.com/blog/2-become-1-merging-two-domains-made-us-an-seo-killing
For completeness you can throw in Apache Traffic server (http://trafficserver.apache.org/) as well. Have you also considered adding a sinkhole feature for if DDOS attack is ever attempted? That is usually a huge feature that is often ignored by side projects and it could be a unique selling point.
Oh yeah, rate limiting is definitely on the list. There's so many features that could be added, so it's mostly a matter of figuring out what potential users would like to see the most.
Also there's a pretty long list of reverse proxies I could add. I should probably mention caddy as well.
I often see this and when discussing it with others I usually suggest what I find as a better domain.
Say you run smooshmetrics.com and you want to separate your stuff out like this... A more memorable name in my opinion is not app.smooshmetrics.com but my.smooshmetrics.com.
Yeah, I see the app.*.com pattern a lot. It's definitely not my favorite. Especially now that .app TLDs are becoming popular. app.routepath.app just looks silly.
Good point! And I like the idea og using "my".
This comment was deleted 5 years ago.
Thanks!
Yep, Let's Encrypt offers an ACME. It's pretty awesome https://letsencrypt.org/docs/client-options/
This comment was deleted 5 years ago.