Route53 alias for S3 and EC2
up vote
0
down vote
favorite
I'm sure I'm missing something simple here, but my problem is this. I'm hosting my web app on aws as an Elastic Beanstalk application. The EC2 instance created has a load balancer associated with it.
I also have a domain registered on aws, and on Route 53, I have an A type configured for the domain and the alias target is the load balancer. That's all working fine.
I also wish to host a static html page for my domain. But to do that according to this - https://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html#root-domain-walkthrough-add-arecord-to-hostedzone, I also need to create another A type alias in Route 53 for the S3 bucket.
The problem is I cant seem to be able to have both. Is there a way to configure my load balancer and/or Route 53 settings to be able to host and serve my static website and my elastic beanstalk instance?
amazon-web-services aws-load-balancer
add a comment |
up vote
0
down vote
favorite
I'm sure I'm missing something simple here, but my problem is this. I'm hosting my web app on aws as an Elastic Beanstalk application. The EC2 instance created has a load balancer associated with it.
I also have a domain registered on aws, and on Route 53, I have an A type configured for the domain and the alias target is the load balancer. That's all working fine.
I also wish to host a static html page for my domain. But to do that according to this - https://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html#root-domain-walkthrough-add-arecord-to-hostedzone, I also need to create another A type alias in Route 53 for the S3 bucket.
The problem is I cant seem to be able to have both. Is there a way to configure my load balancer and/or Route 53 settings to be able to host and serve my static website and my elastic beanstalk instance?
amazon-web-services aws-load-balancer
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm sure I'm missing something simple here, but my problem is this. I'm hosting my web app on aws as an Elastic Beanstalk application. The EC2 instance created has a load balancer associated with it.
I also have a domain registered on aws, and on Route 53, I have an A type configured for the domain and the alias target is the load balancer. That's all working fine.
I also wish to host a static html page for my domain. But to do that according to this - https://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html#root-domain-walkthrough-add-arecord-to-hostedzone, I also need to create another A type alias in Route 53 for the S3 bucket.
The problem is I cant seem to be able to have both. Is there a way to configure my load balancer and/or Route 53 settings to be able to host and serve my static website and my elastic beanstalk instance?
amazon-web-services aws-load-balancer
I'm sure I'm missing something simple here, but my problem is this. I'm hosting my web app on aws as an Elastic Beanstalk application. The EC2 instance created has a load balancer associated with it.
I also have a domain registered on aws, and on Route 53, I have an A type configured for the domain and the alias target is the load balancer. That's all working fine.
I also wish to host a static html page for my domain. But to do that according to this - https://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html#root-domain-walkthrough-add-arecord-to-hostedzone, I also need to create another A type alias in Route 53 for the S3 bucket.
The problem is I cant seem to be able to have both. Is there a way to configure my load balancer and/or Route 53 settings to be able to host and serve my static website and my elastic beanstalk instance?
amazon-web-services aws-load-balancer
amazon-web-services aws-load-balancer
asked Nov 20 at 0:11
bad robot
1593
1593
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
No. Unless you use a reverse proxy like Nginx (in front of ELB) to serve your static page (hosted on S3) on different port or port 443 but on different uri like https://<yourdomain.com>/static
and serve your Elastic Beanstalk web app on port 443 on uri / like https://<yourdomain.com>
.
<yourdomain.com>
-> DNS A record -> Nginx server -> route to ELB or your static page (hosted on S3) depending on which port/uri was requested.
OR
Host your static html page on an EC2 instance and setup a rule on ELB to route requests with /static
in URL path to that EC2 instance.
https://aws.amazon.com/blogs/aws/new-aws-application-load-balancer/
I actually got it working by creating a new certificate and new hosted zone for the subdomainapi.mydomain.com
. Then created an alias in the new zone and associated it with the load balancer. In my originalmydomain.com
zone, I created a CNAME entry for the new certificate and an alias forapi.mydomain.com
associated with the load balancer. Changed the aliases I had formydomain.com
to point to the s3 bucket hosting my static content and changed the load balancer to use the new certificate. And finally changed my web app so that it is running atapi.mydomain.com
.
– bad robot
Nov 28 at 0:02
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53384433%2froute53-alias-for-s3-and-ec2%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
No. Unless you use a reverse proxy like Nginx (in front of ELB) to serve your static page (hosted on S3) on different port or port 443 but on different uri like https://<yourdomain.com>/static
and serve your Elastic Beanstalk web app on port 443 on uri / like https://<yourdomain.com>
.
<yourdomain.com>
-> DNS A record -> Nginx server -> route to ELB or your static page (hosted on S3) depending on which port/uri was requested.
OR
Host your static html page on an EC2 instance and setup a rule on ELB to route requests with /static
in URL path to that EC2 instance.
https://aws.amazon.com/blogs/aws/new-aws-application-load-balancer/
I actually got it working by creating a new certificate and new hosted zone for the subdomainapi.mydomain.com
. Then created an alias in the new zone and associated it with the load balancer. In my originalmydomain.com
zone, I created a CNAME entry for the new certificate and an alias forapi.mydomain.com
associated with the load balancer. Changed the aliases I had formydomain.com
to point to the s3 bucket hosting my static content and changed the load balancer to use the new certificate. And finally changed my web app so that it is running atapi.mydomain.com
.
– bad robot
Nov 28 at 0:02
add a comment |
up vote
1
down vote
No. Unless you use a reverse proxy like Nginx (in front of ELB) to serve your static page (hosted on S3) on different port or port 443 but on different uri like https://<yourdomain.com>/static
and serve your Elastic Beanstalk web app on port 443 on uri / like https://<yourdomain.com>
.
<yourdomain.com>
-> DNS A record -> Nginx server -> route to ELB or your static page (hosted on S3) depending on which port/uri was requested.
OR
Host your static html page on an EC2 instance and setup a rule on ELB to route requests with /static
in URL path to that EC2 instance.
https://aws.amazon.com/blogs/aws/new-aws-application-load-balancer/
I actually got it working by creating a new certificate and new hosted zone for the subdomainapi.mydomain.com
. Then created an alias in the new zone and associated it with the load balancer. In my originalmydomain.com
zone, I created a CNAME entry for the new certificate and an alias forapi.mydomain.com
associated with the load balancer. Changed the aliases I had formydomain.com
to point to the s3 bucket hosting my static content and changed the load balancer to use the new certificate. And finally changed my web app so that it is running atapi.mydomain.com
.
– bad robot
Nov 28 at 0:02
add a comment |
up vote
1
down vote
up vote
1
down vote
No. Unless you use a reverse proxy like Nginx (in front of ELB) to serve your static page (hosted on S3) on different port or port 443 but on different uri like https://<yourdomain.com>/static
and serve your Elastic Beanstalk web app on port 443 on uri / like https://<yourdomain.com>
.
<yourdomain.com>
-> DNS A record -> Nginx server -> route to ELB or your static page (hosted on S3) depending on which port/uri was requested.
OR
Host your static html page on an EC2 instance and setup a rule on ELB to route requests with /static
in URL path to that EC2 instance.
https://aws.amazon.com/blogs/aws/new-aws-application-load-balancer/
No. Unless you use a reverse proxy like Nginx (in front of ELB) to serve your static page (hosted on S3) on different port or port 443 but on different uri like https://<yourdomain.com>/static
and serve your Elastic Beanstalk web app on port 443 on uri / like https://<yourdomain.com>
.
<yourdomain.com>
-> DNS A record -> Nginx server -> route to ELB or your static page (hosted on S3) depending on which port/uri was requested.
OR
Host your static html page on an EC2 instance and setup a rule on ELB to route requests with /static
in URL path to that EC2 instance.
https://aws.amazon.com/blogs/aws/new-aws-application-load-balancer/
edited Nov 20 at 0:48
answered Nov 20 at 0:36
ben5556
1,612139
1,612139
I actually got it working by creating a new certificate and new hosted zone for the subdomainapi.mydomain.com
. Then created an alias in the new zone and associated it with the load balancer. In my originalmydomain.com
zone, I created a CNAME entry for the new certificate and an alias forapi.mydomain.com
associated with the load balancer. Changed the aliases I had formydomain.com
to point to the s3 bucket hosting my static content and changed the load balancer to use the new certificate. And finally changed my web app so that it is running atapi.mydomain.com
.
– bad robot
Nov 28 at 0:02
add a comment |
I actually got it working by creating a new certificate and new hosted zone for the subdomainapi.mydomain.com
. Then created an alias in the new zone and associated it with the load balancer. In my originalmydomain.com
zone, I created a CNAME entry for the new certificate and an alias forapi.mydomain.com
associated with the load balancer. Changed the aliases I had formydomain.com
to point to the s3 bucket hosting my static content and changed the load balancer to use the new certificate. And finally changed my web app so that it is running atapi.mydomain.com
.
– bad robot
Nov 28 at 0:02
I actually got it working by creating a new certificate and new hosted zone for the subdomain
api.mydomain.com
. Then created an alias in the new zone and associated it with the load balancer. In my original mydomain.com
zone, I created a CNAME entry for the new certificate and an alias for api.mydomain.com
associated with the load balancer. Changed the aliases I had for mydomain.com
to point to the s3 bucket hosting my static content and changed the load balancer to use the new certificate. And finally changed my web app so that it is running at api.mydomain.com
.– bad robot
Nov 28 at 0:02
I actually got it working by creating a new certificate and new hosted zone for the subdomain
api.mydomain.com
. Then created an alias in the new zone and associated it with the load balancer. In my original mydomain.com
zone, I created a CNAME entry for the new certificate and an alias for api.mydomain.com
associated with the load balancer. Changed the aliases I had for mydomain.com
to point to the s3 bucket hosting my static content and changed the load balancer to use the new certificate. And finally changed my web app so that it is running at api.mydomain.com
.– bad robot
Nov 28 at 0:02
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53384433%2froute53-alias-for-s3-and-ec2%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown