Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Essentially, I need to know how to point one URL/folder to a web server and a different URL/folder to an EC2 app server. I'm trying to setup a SAAS with the following URL configuration. --> forward to --> company public page hosted on S3

All other URLs should point to EC2 servers where my SAAS is running on NGINX and PHP. How can I configure this? Ideally, I'd like the users accessing the company public page to avoid hitting the nginx servers and go directly to the S3 hosting. Is that possible? I'd like to use AWS Route53 and Cloudfront.


share|improve this question

Because you're using S3 and Cloudfront, this is possible. You can setup multiple behaviours, each with a path pattern that then fetches content from different origins, as well as use S3 redirects.

So to do this:

  • Setup a redirect, using instructions at so the S3 bucket redirects from the root / -> /site/

  • You then setup different behaviours on Cloudfront:

    Behaviour 1

    Path Pattern: /
    Origin: The S3 bucket

    Behaviour 2:

    Path Pattern: /site/*
    Origin: The S3 bucket

    Behaviour 3:

    Path Pattern: *
    Origin: The webserver on EC2

(Yes... I know this answer is very late!)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.