Is it possible to deploy a HTTP site to API gateway to make it HTTPS? - wordpress

I'm new to API gateway,
I have a simple wordpress site at http://myexamplewordpress.tech
I want to point this URL to my API gateway invoke URL
and then assign a cname to API gateway invoke URL
So users can access my site using the cname myexamplewordpress.tech which would be HTTPS since its an API gateway invoke URL essentially..
Is this something that is possible ? please help me out
Clarification
I already have a domain name in .tech which is not supported in route 53 from 3rd party.. say my current site is http://myexamplewordpress.tech i want this to point to API gateway URL and assign a cname to api gateway URL which i will do from my 3rd party so my final URL should look like https://myexamplewordpress.tech i want to make it HTTPS thats what i am after in the long run
Question
Can i make my site HTTPS using API gateway only ?

Yes, you can make your wordpress domain HTTPS-capable using API Gateway.
You could use the new HTTP API feature for this [1] in conjunction with HTTP integrations [2] and greedy paths.
However, you will also need AWS Certificate Manager (ACM) to create an SSL certificate for your custom domain name. [3]
Alternative
Furthermore, I would suggest to take into account AWS CloudFront as an alternative solution. I think it fits your usecase better. It supports SSL using ACM and moreover distributes your content over the continent, providing lower latency to readers. AWS provided a blog post which outlines a CloudFront solution specifically for Wordpress. [4] It slightly differs from your scenario by hosting the wordpress blog on EC2 instances within a VPC (behind an ELB). However, you could use the exact same CloudFront distribution settings with a modified origin which points at your external wordpress server instead at an S3 bucket with static assets and an ELB for dynamic content. Take a look at the blog post. It might save you some time if you want to configure things quickly.
References
[1] https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api.html
[2] https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-http.html
[3] https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-custom-domain-names.html
[4] https://aws.amazon.com/de/blogs/startups/how-to-accelerate-your-wordpress-site-with-amazon-cloudfront/

Related

Custom domain for an IBM Cloud static website

The problem I am trying to solve is to configure a custom domain name, such as example.com and www.example.com for an IBM Object Storage Static Website. The part I especially need help with is the domain validation part.
Using the tutorial Accelerate delivery of static files using a CDN I have created an IBM Cloud Object Storage Static Website. My browser says that site (page) is dangerous but I am not sure why; that address is the public endpoint for the index.html document.
I tried to configure static.whateversam.com for the site. Currently the DNS does not have a CNAME or A record. I have created a CDN (Network) resource. The status is Domain validation required. When I view the details of that then view domain validation I get a pop-up with 4 tabs. The first tab is for CNAME and the description says ONLY if your domain is not serving live traffic. I do not know what that means but I seem to be using that. The second tab is for Challenge domain. I have tried to use that but when I try to edit the CDN details I am unable to edit the CNAME and other settings.
The tutorial uses static.yourdomain.com for the domain. I am not sure I can use the same procedure for www.yourdomain.com and for yourdomain.com. I am interested in complete and understandable instructions for configuring a custom domain for an IBM Object Storage Static Website but that might be a separate question.

Webflow with self hosted ghost blog

Is there a way to run webflow & ghost together where - https://example.com/* is served by webflow and https://example.com/blog/* is served via my self hosted ghost server.
How do I put the IP of my ghost server in my domain's DNS record?
Or is there any other way to do this?
You could use subdomains instead of an extended URL.
Reference blog.example.com to the IP address of your ghost server.
To reference:
Connect a custom domain to the webflow site.
Go to the DNS manager of the custom domain.
If you have an IP address for the ghost server, then:
Add an A record with NAME = [subdomain] (here [subdomain] = blog) and Value = [IP address]
else If you have a domain name for the ghost server, then:
Add an CNAME record with NAME = [subdomain] (here [subdomain] = blog) and Value = [Domain Name]
You can only achieve this if you have an active webflow hosting using
a paid site plan which enables you to add a custom domain.
I would not recommend using a subdomain for your blog, for SEO reasons.
So if you want to use your hosted Webflow site in combination with a (own hosted) Ghost blog on the same domain name, for example on yourdomain.com/blog/ one way of achieving this by setting up a reverse proxy.
Your can read the whole set up here:
https://signoz.io/blog/webflow-ghost-subdirectory/
You would need to setup an independent reverse proxy server - using a web server such as Nginx or Caddy. You would then point your root domain to this server and reverse proxy to both your Webflow site and your Ghost site depending on the URL route.
Alternatively you could try to do this using Cloudflare Workers (Google for "using cloudflare worker as reverse proxy") or for a no code / managed solution you could try a service such as HostForward which does it all for you.

Cloudfront domain name not working to redirect HTTP to HTTPS using S3, Cloudfront, and Route 53

First post here - hello fellow stackoverflowers :)
Website issue.
Bought domain on Google, hosting on S3. Used route 53 to redirect requests.
Created 2 public buckets in S3, example.com and www.example.com (example.com redirecting to www)
WEBSITE WORKS - YES! Now let's get it https
Got the SSL amazon certificate for *.example.com via route 53 DNS confirmation.
Uploaded it to my cloudfront distribution ( and in the parameters ensured http redirects to https).
Following this article (How to redirect HTTP to HTTPS using S3, Cloudfront, and Route 53 using naked domains? ), I now need to redirect requests from route 53 towards the Cloudfront domain name.
But the Cloudfront domain name gives an error message ( see below). Where could it come from? (I understand this should be the https website link no?)
error message
FYII don't use an EC2 instance. I understand there is another way of getting an SSL by passing through providers like Namecheap - but it seems much more complicated ( compared to Amazon doing it for free).
Probably your CloudFront origin is pointing at the wrong endpoint. Don't pick the auto-suggested bucket from the origin list, instead explicitly copy the endpoint shown in your S3 bucket under "Static website hosting", which should look something like example.com.s3-website-us-east-1.amazonaws.com. Otherwise you're pointing at the S3 bucket HTTP interface, not the website host.
Just to make sure, the entire process is basically:
Set up the domain zone in Route 53 first, so it exists for the next step.
In region US-East-1 (N. Virginia, important!), create a certificate request for the domain in Certificate Manager. Use DNS validation, and let AWS auto-insert the required records to your Route 53 configuration you created in 1.
Create the S3 bucket.
Explicitly set a custom bucket policy to allow anonymous access.
Enable "Static website hosting" for the bucket. Note the displayed endpoint.
Create a CloudFront distribution, add your domain name as Alternate Domain Name, choose the certificate created in 2. from the list, add the endpoint noted in 5. as origin.
Update the Route 53 configuration to add an A (and AAAA) alias record, pointing to the CloudFront distribution, which you can choose from the auto-suggested list.
Wait until everything is deployed.
Especially the certificate you'd want to create as described, since this allows it to auto-renew and you won't have to worry about it. CloudFront can only automatically use certificates created in region US-East-1, creating your certificates elsewhere means you'll need to down/upload them manually, and do that every time they expire.

How to change URL of Pivotal Cloud Foundry web application

I have just pushed a Spring Boot / VueJS application to Pivotal Cloud Foundry and was wondering how I change the URL for the website?
When I pushed the application they gave me a URL of http://crdeckhelper.cfapps.io/
I went to godaddy and bought a domain of crwardecks.com
How do I make my application run on crwardecks.com?
I currently have godaddy re-routing the person to the URL that cloud foundry generated for me, but this is not the behavior that I want.
I have read the documentation on Pivotal but for some reason it confuses me. I have also searched for this on the web but wasn't able to find a good resource.
There's a couple things you need to do.
Add your domain to Cloud Foundry. Run cf create-domain.
https://docs.run.pivotal.io/devguide/deploy-apps/routes-domains.html#private-domains
Map a route under this domain to your app. Run cf map-route <app> <domain> ....
https://docs.run.pivotal.io/devguide/deploy-apps/routes-domains.html#map-route
At this point, you'll have the domain and route set up in CF, but nothing is sending traffic to CF.
To send traffic to your CF, you need to make an adjustment in your DNS records. Again, there's a couple of options.
You can route traffic for just one subdomain to the app, by creating a CNAME record that points from your custom domain to the domain assigned by CF. Ex: CNAME: www.example.com -> crdeckhelper.cfapps.io.
You can route traffic for all subdomains with a wildcard. Again we use a CNAME record but this time we use a wildcard. Ex: CNAME: *.example.com -> *.cfapps.io (or you could use some subdomain, like *.sub.cfapps.io).
Both are described more here. Also, cfapps.io is part of Pivotal Web Services. If you use a different provider then your shared domain will be different.
At this point, you should have traffic routing to CF & CF should be routing traffic to your specific app. Your done & you can stop reading, unless you are trying to map a root domain to your app.
There's an edge case around root domains (i.e. example.com, not www.example.com), because DNS CNAME records don't work for a root domain. Some DNS providers support ALIAS or ANAME records, which work like a CNAME record for root domains. If your provider does, you can give it a try (see your DNS provider's doc for instructions on how to use). If not, see if your provider supports URL forwarding. Many DNS providers will automatically redirect HTTP traffic on the root domain to a sub domain you specify, like example.com -> HTTP 302 -> www.example.com.
For more on root domain setup, see Configuring DNS for Your Registered Root Domain at the following link.
https://docs.run.pivotal.io/devguide/deploy-apps/routes-domains.html#domains-dns
As a last resort, you could use an A record, but you need to be very careful because your CF providers may not have static public IPs, rather their IPs can change. If you use an A record and your provider's IP changes, traffic will stop flowing to your app & you'll need to update your A record to point to their new IPs (you can get your provider's IPs by running dig <app-dns> or nslookup <app-dns>. If you go this route, make sure you have monitoring to quickly catch when IPs change.
Hope that helps!

Diverting web traffic from one Azure Web app to another without downtime

I have two Azure web apps:
webapp1.azurewebsites.net
webapp2.azurewebsites.net
webapp1 is my live website, which is configured with a custom domain, www.example.com.
I want to divert all incoming traffic so that it goes to webapp2, rather than webapp1.
My plan to do this was:
Add the custom domain 'www.example.com' to webapp2.
Change the DNS CNAME record for www.example.com so that it points to webapp2.azurewebsites.net (instead of webapp1.azurewebsites.net).
However, this approach doesn't work; When I try to add the custom domain name to webapp2 using portal.azure.com, I get the error: 'The host name www.example.com' is already assigned to another Azure website'.
It's important to ensure that there is no downtime in this transition, so removing the custom domain name from webapp1 before adding it to webapp2 isn't an option.
Any ideas on how I can solve this problem?
As per the previous answer, you can use Azure Traffic Manager to control traffic between Web Apps. However, you will still face the problem of registering the custom domain name against both web apps. The Traffic Manager documentation contains further information about how to do this - see "Can I use Traffic Manager with more than one Web App in the same region?" in the FAQ section here.
The key point is that if the Web Apps are in the same region, then they need to be in different scale units. The instructions linked above show how to check which scale unit your Web App is in. You can't control the scale unit when deploying the Web App, but if you submit a Support ticket you may be able to have your Web Apps deployed to different scale units by Azure Support.
One potential way may be to configure a traffic manager. You could create a traffic manager and add webapp1 and webapp2 as end points. You could also configure the traffic manager to use failover routing with webapp1 being the primary and webapp2 being the failover.
Then you cloud change the custom domain to point at the traffic manager so that traffic continues to flow to the site through the traffic manager. That hopefully would allow you to remove the custom domain from webapp1 config and then configure webapp2 to use it. You could then change the custom domain to point at webapp2 and remove the traffic manager.
Alternately you can leave the traffic manager in place and just remove webapp1 as an endpoint.
I haven't tested this approach yet but if I get a chance to I'll update this answer with any notes.

Resources