How to setup AWS cloudfront with lightsail for WordPress?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
How to setup AWS cloudfront with lightsail for WordPress? (on a subdomain)
- I'm using Route 53 for all DNS management. I'm using a static IP from
lightsail, 3.122.2.187 - Route 53 has an A record for service.openinfo.nl using an ALIAS to the cloudfront domain name.
- Route 53 has an A record for wordpress.openinfo.nl pointing to the
lightsail static IP 3.122.2.187 - Cloudfront has an origin domain name of wordpress.openinfo.nl
- Cloudfront Origin Protocol Policy is HTTP Only.
- Cloudfront Alternate Domain Names is service.openinfo.nl
- Cloudfront SSL Certificate is the one issued by Route53 for *.openinfo.nl
- Cloudfront Viewer Protocol Policy is Redirect HTTP to HTTPS.
This solution does not work:
The cloudfront distribution service.openinfo.nl does resolve the lightsail server but over http, it does not use the certificate I attached... Should I use redirect http to https?
Also, if I click 'login' it redirects to wordpress.openinfo.nl/wp-login.php i.e. the DNS that I assigned for the purpose of orgin domain name to cloudfront. The WordPress "WP_SITEURL" and "WP_HOME" settings somehow automatically reflect the DNS wordpress.openinfo.nl.
And also, the DNS name wordpress.openinfo.nl resolves the lightsail server (which I don't want because I want all trafic to the wordpress server to go via service.openinfo.nl). How to avoid this?
Background and what I tried:
My lightsail (WordPress) server does not show up in the "Origin Domain Name" dropdown list when creating a new distribution. So what should I do? The only AWS description on this topic that I can find is not clear on that to me.
Using the servers fixed IP address as "Origin Domain Name" in cloudfront is not allowed. So I created a DNS record in Route 53 (wordpress.openinfo.nl) to point to the static IP of my lightsail server. And I added this DNS record as "Origin Domain Name" in cloudfront (also including a https certificate *.openinfo.nl). And I selected the cloudfront distribution as A record, type alias, in Route 53. The cloudfront Alternate Domain Names (CNAMEs) is service.openinfo.nl .
So I also tried creating the service.openinfo.nl as A record (DNS) in Route 53 pointing to the static IP of the WordPress lightsail server. But then I cannot create the same service.openinfo.nl as alias A record...
So I am stuck... Please advice? Many thanks in advance! Wouter
PS: openinfo.nl points to a cloudfront distribution with a certificate which points to a static site in a S3 buckets and works fine.
wordpress amazon-web-services amazon-cloudfront amazon-route53 amazon-lightsail
add a comment |
How to setup AWS cloudfront with lightsail for WordPress? (on a subdomain)
- I'm using Route 53 for all DNS management. I'm using a static IP from
lightsail, 3.122.2.187 - Route 53 has an A record for service.openinfo.nl using an ALIAS to the cloudfront domain name.
- Route 53 has an A record for wordpress.openinfo.nl pointing to the
lightsail static IP 3.122.2.187 - Cloudfront has an origin domain name of wordpress.openinfo.nl
- Cloudfront Origin Protocol Policy is HTTP Only.
- Cloudfront Alternate Domain Names is service.openinfo.nl
- Cloudfront SSL Certificate is the one issued by Route53 for *.openinfo.nl
- Cloudfront Viewer Protocol Policy is Redirect HTTP to HTTPS.
This solution does not work:
The cloudfront distribution service.openinfo.nl does resolve the lightsail server but over http, it does not use the certificate I attached... Should I use redirect http to https?
Also, if I click 'login' it redirects to wordpress.openinfo.nl/wp-login.php i.e. the DNS that I assigned for the purpose of orgin domain name to cloudfront. The WordPress "WP_SITEURL" and "WP_HOME" settings somehow automatically reflect the DNS wordpress.openinfo.nl.
And also, the DNS name wordpress.openinfo.nl resolves the lightsail server (which I don't want because I want all trafic to the wordpress server to go via service.openinfo.nl). How to avoid this?
Background and what I tried:
My lightsail (WordPress) server does not show up in the "Origin Domain Name" dropdown list when creating a new distribution. So what should I do? The only AWS description on this topic that I can find is not clear on that to me.
Using the servers fixed IP address as "Origin Domain Name" in cloudfront is not allowed. So I created a DNS record in Route 53 (wordpress.openinfo.nl) to point to the static IP of my lightsail server. And I added this DNS record as "Origin Domain Name" in cloudfront (also including a https certificate *.openinfo.nl). And I selected the cloudfront distribution as A record, type alias, in Route 53. The cloudfront Alternate Domain Names (CNAMEs) is service.openinfo.nl .
So I also tried creating the service.openinfo.nl as A record (DNS) in Route 53 pointing to the static IP of the WordPress lightsail server. But then I cannot create the same service.openinfo.nl as alias A record...
So I am stuck... Please advice? Many thanks in advance! Wouter
PS: openinfo.nl points to a cloudfront distribution with a certificate which points to a static site in a S3 buckets and works fine.
wordpress amazon-web-services amazon-cloudfront amazon-route53 amazon-lightsail
any insight on how to setup cloudfront for wordpress on lightsail ?
– Pak
Nov 29 '18 at 17:11
Not yet unfortunately, I set up an EC2 instance instead, it’s elastic IP can be used as origin domain name in cloudfront. I guess lightsail does not have this feature...
– Wouter
Dec 3 '18 at 7:14
add a comment |
How to setup AWS cloudfront with lightsail for WordPress? (on a subdomain)
- I'm using Route 53 for all DNS management. I'm using a static IP from
lightsail, 3.122.2.187 - Route 53 has an A record for service.openinfo.nl using an ALIAS to the cloudfront domain name.
- Route 53 has an A record for wordpress.openinfo.nl pointing to the
lightsail static IP 3.122.2.187 - Cloudfront has an origin domain name of wordpress.openinfo.nl
- Cloudfront Origin Protocol Policy is HTTP Only.
- Cloudfront Alternate Domain Names is service.openinfo.nl
- Cloudfront SSL Certificate is the one issued by Route53 for *.openinfo.nl
- Cloudfront Viewer Protocol Policy is Redirect HTTP to HTTPS.
This solution does not work:
The cloudfront distribution service.openinfo.nl does resolve the lightsail server but over http, it does not use the certificate I attached... Should I use redirect http to https?
Also, if I click 'login' it redirects to wordpress.openinfo.nl/wp-login.php i.e. the DNS that I assigned for the purpose of orgin domain name to cloudfront. The WordPress "WP_SITEURL" and "WP_HOME" settings somehow automatically reflect the DNS wordpress.openinfo.nl.
And also, the DNS name wordpress.openinfo.nl resolves the lightsail server (which I don't want because I want all trafic to the wordpress server to go via service.openinfo.nl). How to avoid this?
Background and what I tried:
My lightsail (WordPress) server does not show up in the "Origin Domain Name" dropdown list when creating a new distribution. So what should I do? The only AWS description on this topic that I can find is not clear on that to me.
Using the servers fixed IP address as "Origin Domain Name" in cloudfront is not allowed. So I created a DNS record in Route 53 (wordpress.openinfo.nl) to point to the static IP of my lightsail server. And I added this DNS record as "Origin Domain Name" in cloudfront (also including a https certificate *.openinfo.nl). And I selected the cloudfront distribution as A record, type alias, in Route 53. The cloudfront Alternate Domain Names (CNAMEs) is service.openinfo.nl .
So I also tried creating the service.openinfo.nl as A record (DNS) in Route 53 pointing to the static IP of the WordPress lightsail server. But then I cannot create the same service.openinfo.nl as alias A record...
So I am stuck... Please advice? Many thanks in advance! Wouter
PS: openinfo.nl points to a cloudfront distribution with a certificate which points to a static site in a S3 buckets and works fine.
wordpress amazon-web-services amazon-cloudfront amazon-route53 amazon-lightsail
How to setup AWS cloudfront with lightsail for WordPress? (on a subdomain)
- I'm using Route 53 for all DNS management. I'm using a static IP from
lightsail, 3.122.2.187 - Route 53 has an A record for service.openinfo.nl using an ALIAS to the cloudfront domain name.
- Route 53 has an A record for wordpress.openinfo.nl pointing to the
lightsail static IP 3.122.2.187 - Cloudfront has an origin domain name of wordpress.openinfo.nl
- Cloudfront Origin Protocol Policy is HTTP Only.
- Cloudfront Alternate Domain Names is service.openinfo.nl
- Cloudfront SSL Certificate is the one issued by Route53 for *.openinfo.nl
- Cloudfront Viewer Protocol Policy is Redirect HTTP to HTTPS.
This solution does not work:
The cloudfront distribution service.openinfo.nl does resolve the lightsail server but over http, it does not use the certificate I attached... Should I use redirect http to https?
Also, if I click 'login' it redirects to wordpress.openinfo.nl/wp-login.php i.e. the DNS that I assigned for the purpose of orgin domain name to cloudfront. The WordPress "WP_SITEURL" and "WP_HOME" settings somehow automatically reflect the DNS wordpress.openinfo.nl.
And also, the DNS name wordpress.openinfo.nl resolves the lightsail server (which I don't want because I want all trafic to the wordpress server to go via service.openinfo.nl). How to avoid this?
Background and what I tried:
My lightsail (WordPress) server does not show up in the "Origin Domain Name" dropdown list when creating a new distribution. So what should I do? The only AWS description on this topic that I can find is not clear on that to me.
Using the servers fixed IP address as "Origin Domain Name" in cloudfront is not allowed. So I created a DNS record in Route 53 (wordpress.openinfo.nl) to point to the static IP of my lightsail server. And I added this DNS record as "Origin Domain Name" in cloudfront (also including a https certificate *.openinfo.nl). And I selected the cloudfront distribution as A record, type alias, in Route 53. The cloudfront Alternate Domain Names (CNAMEs) is service.openinfo.nl .
So I also tried creating the service.openinfo.nl as A record (DNS) in Route 53 pointing to the static IP of the WordPress lightsail server. But then I cannot create the same service.openinfo.nl as alias A record...
So I am stuck... Please advice? Many thanks in advance! Wouter
PS: openinfo.nl points to a cloudfront distribution with a certificate which points to a static site in a S3 buckets and works fine.
wordpress amazon-web-services amazon-cloudfront amazon-route53 amazon-lightsail
wordpress amazon-web-services amazon-cloudfront amazon-route53 amazon-lightsail
edited Nov 23 '18 at 13:02
Wouter
asked Nov 23 '18 at 12:40
WouterWouter
3991315
3991315
any insight on how to setup cloudfront for wordpress on lightsail ?
– Pak
Nov 29 '18 at 17:11
Not yet unfortunately, I set up an EC2 instance instead, it’s elastic IP can be used as origin domain name in cloudfront. I guess lightsail does not have this feature...
– Wouter
Dec 3 '18 at 7:14
add a comment |
any insight on how to setup cloudfront for wordpress on lightsail ?
– Pak
Nov 29 '18 at 17:11
Not yet unfortunately, I set up an EC2 instance instead, it’s elastic IP can be used as origin domain name in cloudfront. I guess lightsail does not have this feature...
– Wouter
Dec 3 '18 at 7:14
any insight on how to setup cloudfront for wordpress on lightsail ?
– Pak
Nov 29 '18 at 17:11
any insight on how to setup cloudfront for wordpress on lightsail ?
– Pak
Nov 29 '18 at 17:11
Not yet unfortunately, I set up an EC2 instance instead, it’s elastic IP can be used as origin domain name in cloudfront. I guess lightsail does not have this feature...
– Wouter
Dec 3 '18 at 7:14
Not yet unfortunately, I set up an EC2 instance instead, it’s elastic IP can be used as origin domain name in cloudfront. I guess lightsail does not have this feature...
– Wouter
Dec 3 '18 at 7:14
add a comment |
1 Answer
1
active
oldest
votes
https://aws.amazon.com/blogs/startups/how-to-accelerate-your-wordpress-site-with-amazon-cloudfront/
https://forums.aws.amazon.com/thread.jspa?threadID=264002
First of all, you need to point your domain to CloudFront. You will want to set up a CNAME record in your DNS zone, pointing to the xyz.cloudfront.net address you get when creating the CloudFront distribution. The name of that record should be "www.example.com" if that's the domain you want to enable CloudFront on. Making example.com (without www) work as well could be a bit more tricky as you can't use a CNAME for technical reasons. Route 53 offers a way around this, but the DNS management in Lightsail is a simpler version of that service essentially. But you can always add an A record for example.com, pointing to your server IP address. Then your server can redirect those requests (additional configuration needed).
Secondly, CloudFront needs to contact your server on some address. You could add a second record to your DNS zone. This time you call it "origin.example.com" (or anything really), make it an A record, and point it to the server IP address.
Thanks for your answer. It does not address my challenge with the WordPress specific configuration but please don't bother: I have by now set up an EC2 instance in stead of a Lightsail instance and I am happy with how it works so I am not diving any deeper into this topic.
– Wouter
Mar 2 at 12:10
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',
autoActivateHeartbeat: false,
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%2f53446900%2fhow-to-setup-aws-cloudfront-with-lightsail-for-wordpress%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
https://aws.amazon.com/blogs/startups/how-to-accelerate-your-wordpress-site-with-amazon-cloudfront/
https://forums.aws.amazon.com/thread.jspa?threadID=264002
First of all, you need to point your domain to CloudFront. You will want to set up a CNAME record in your DNS zone, pointing to the xyz.cloudfront.net address you get when creating the CloudFront distribution. The name of that record should be "www.example.com" if that's the domain you want to enable CloudFront on. Making example.com (without www) work as well could be a bit more tricky as you can't use a CNAME for technical reasons. Route 53 offers a way around this, but the DNS management in Lightsail is a simpler version of that service essentially. But you can always add an A record for example.com, pointing to your server IP address. Then your server can redirect those requests (additional configuration needed).
Secondly, CloudFront needs to contact your server on some address. You could add a second record to your DNS zone. This time you call it "origin.example.com" (or anything really), make it an A record, and point it to the server IP address.
Thanks for your answer. It does not address my challenge with the WordPress specific configuration but please don't bother: I have by now set up an EC2 instance in stead of a Lightsail instance and I am happy with how it works so I am not diving any deeper into this topic.
– Wouter
Mar 2 at 12:10
add a comment |
https://aws.amazon.com/blogs/startups/how-to-accelerate-your-wordpress-site-with-amazon-cloudfront/
https://forums.aws.amazon.com/thread.jspa?threadID=264002
First of all, you need to point your domain to CloudFront. You will want to set up a CNAME record in your DNS zone, pointing to the xyz.cloudfront.net address you get when creating the CloudFront distribution. The name of that record should be "www.example.com" if that's the domain you want to enable CloudFront on. Making example.com (without www) work as well could be a bit more tricky as you can't use a CNAME for technical reasons. Route 53 offers a way around this, but the DNS management in Lightsail is a simpler version of that service essentially. But you can always add an A record for example.com, pointing to your server IP address. Then your server can redirect those requests (additional configuration needed).
Secondly, CloudFront needs to contact your server on some address. You could add a second record to your DNS zone. This time you call it "origin.example.com" (or anything really), make it an A record, and point it to the server IP address.
Thanks for your answer. It does not address my challenge with the WordPress specific configuration but please don't bother: I have by now set up an EC2 instance in stead of a Lightsail instance and I am happy with how it works so I am not diving any deeper into this topic.
– Wouter
Mar 2 at 12:10
add a comment |
https://aws.amazon.com/blogs/startups/how-to-accelerate-your-wordpress-site-with-amazon-cloudfront/
https://forums.aws.amazon.com/thread.jspa?threadID=264002
First of all, you need to point your domain to CloudFront. You will want to set up a CNAME record in your DNS zone, pointing to the xyz.cloudfront.net address you get when creating the CloudFront distribution. The name of that record should be "www.example.com" if that's the domain you want to enable CloudFront on. Making example.com (without www) work as well could be a bit more tricky as you can't use a CNAME for technical reasons. Route 53 offers a way around this, but the DNS management in Lightsail is a simpler version of that service essentially. But you can always add an A record for example.com, pointing to your server IP address. Then your server can redirect those requests (additional configuration needed).
Secondly, CloudFront needs to contact your server on some address. You could add a second record to your DNS zone. This time you call it "origin.example.com" (or anything really), make it an A record, and point it to the server IP address.
https://aws.amazon.com/blogs/startups/how-to-accelerate-your-wordpress-site-with-amazon-cloudfront/
https://forums.aws.amazon.com/thread.jspa?threadID=264002
First of all, you need to point your domain to CloudFront. You will want to set up a CNAME record in your DNS zone, pointing to the xyz.cloudfront.net address you get when creating the CloudFront distribution. The name of that record should be "www.example.com" if that's the domain you want to enable CloudFront on. Making example.com (without www) work as well could be a bit more tricky as you can't use a CNAME for technical reasons. Route 53 offers a way around this, but the DNS management in Lightsail is a simpler version of that service essentially. But you can always add an A record for example.com, pointing to your server IP address. Then your server can redirect those requests (additional configuration needed).
Secondly, CloudFront needs to contact your server on some address. You could add a second record to your DNS zone. This time you call it "origin.example.com" (or anything really), make it an A record, and point it to the server IP address.
answered Jan 23 at 23:35
Passer ThruPasser Thru
1
1
Thanks for your answer. It does not address my challenge with the WordPress specific configuration but please don't bother: I have by now set up an EC2 instance in stead of a Lightsail instance and I am happy with how it works so I am not diving any deeper into this topic.
– Wouter
Mar 2 at 12:10
add a comment |
Thanks for your answer. It does not address my challenge with the WordPress specific configuration but please don't bother: I have by now set up an EC2 instance in stead of a Lightsail instance and I am happy with how it works so I am not diving any deeper into this topic.
– Wouter
Mar 2 at 12:10
Thanks for your answer. It does not address my challenge with the WordPress specific configuration but please don't bother: I have by now set up an EC2 instance in stead of a Lightsail instance and I am happy with how it works so I am not diving any deeper into this topic.
– Wouter
Mar 2 at 12:10
Thanks for your answer. It does not address my challenge with the WordPress specific configuration but please don't bother: I have by now set up an EC2 instance in stead of a Lightsail instance and I am happy with how it works so I am not diving any deeper into this topic.
– Wouter
Mar 2 at 12:10
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.
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%2f53446900%2fhow-to-setup-aws-cloudfront-with-lightsail-for-wordpress%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
any insight on how to setup cloudfront for wordpress on lightsail ?
– Pak
Nov 29 '18 at 17:11
Not yet unfortunately, I set up an EC2 instance instead, it’s elastic IP can be used as origin domain name in cloudfront. I guess lightsail does not have this feature...
– Wouter
Dec 3 '18 at 7:14