Reputation: 1434
Here is my setup.
My question is how can i setup the DNS to achieve this? If can't do it just through DNS, any suggestions? The problem i am facing is that if squarespace.com is handling the www.example-domain.com traffic how can i have it only partially handle it for certain urls. Maybe i am going about this in the wrong was all together though.
Upvotes: 0
Views: 210
Reputation: 1120
The two first are ok. As you mention, (1) is not compatible with (3) for a pure DNS config as www
of example-domain.com
has to be configured to a single end-point.
Some ideas of non-DNS workaround:
sqsp.example-domain.com
and configure your www
domain to a custom web server on which you configure the root (/
) to redirect (HTTP 300) to sqsp.example-domain.com
. It will be quite transparent for the user, except in his browser address./
a full page HTML iframe containing sqsp.example-domain.com
. The iframe approach is a "less clean", Google the solutions to build your opinion.
EDIT: As @mike-ryan mentioned, there is the proxy solution as well where you configure you web server to request another server to get the content to return to your user. If you are already using AWS, a smart way to do this is to use CloudFront: you can setup CloudFront to proxy one server on one URL and proxy another server on other URL. Actually, this is maybe the faster to way to implement you need. Of course, a proxy is one more "hop", so it may add more delay.
Upvotes: 2
Reputation: 1438
If you really want to have content served from different servers while only using a single domain name, you'll need to set up a proxy server to handle the request routing for you. I am assuming your custom profile pages must be served from your EC2 instance.
Nginx will receive all requests, and will then decide whether they should be sent to Square Space or your web app. Requests will be reverse proxied to Square Space or to your app, depending on the URL.
This is similar to @smad's answer, except it will all be invisible to the users which IMHO is better than redirecting the user to a new domain name.
Example steps:
[0] how to reverse proxy via nginx a specific url?
Upvotes: 2