I am trying to use the directions given in
https://www.npmjs.com/package/express-subdomain
to set up subdomain.
I a hosting my server in amazon EC2 and the DNS provider is google-DNS.
but I am getting error while accessing the page.
404. That’s an error.
The requested URL / was not found on this server. That’s all we know.
So I need to do any configuration in EC2 or in my DNS?
Related
Im currently trying to move my current redirect engine off a nginx proxy on a linux box to Azure. Currently ive been triyng to do it with this example:
dev.oldurl.com --> dev.newurl.com
This is the rule I currently have:
CDN Rules
When I have gone to the URL, im just getting a certificate error, I should also add that on the Domains section on the CDN I have this error "CNAME/alias record is not currently detected" I can confirm these are present in our on prem DNS server.
Thanks in advance.
As for the certificate error. You should have certificates corresponding to the URL's/domain names you are using in respective places. So the nginx server object receiving and redirecting dev.oldurl.com requests should have a certificate for dev.oldurl.com and the server receiving/handling requests for dev.newurl.com should have a certificate for dev.newurl.com.
For the CNAME record error, the Azure CDN will be looking at the public DNS records published on the internet. So you should check with your internet DNS provider for your domain to update the records.
I'm not able to get my nodejs api working using elastic beanstalk, cloudfront distribution and route 53. I need my api to be running behind an SSL, this is why I'm using cloudfront distribution. I have the following setup.
When I visit my api https://api.mydomain.com I get a 504 with the error message below.
The actual url my api is running on (successfully, using nodejs elastic with beanstalk) is http://dummy-env.n1eijsdai.eu-west-1.elasticbeanstalk.com. I just want to mask that url as api.mydomain.com together with an SSL.
Is there something I've got wrong/ can you suggest anything to try?
Looking through the configuration for cloudfront this looks strange, the picture shows the setting prefixed with S3 but this api is not on an S3 (at least directly) it is hosted by elastic beanstalk.
Thanks,
Error message
504 ERROR
The request could not be satisfied.
CloudFront attempted to establish a connection with the origin, but either the attempt failed or the origin closed the connection.
If you received this error while trying to use an app or access a website, please contact the provider or website owner for assistance.
Route 53
name = api.mydomain.com
Type = (A) Alias target = wqsdn31817
CloudFront Distributions
domain name = wqsdn31817
origin = dummy-env.n1eijsdai.eu-west-1.elasticbeanstalk.com (if I visit this url I see my api running)
SSL certificate = api.mydomain.com
status = deployed
Origin Settings/ Origin Domain Name = http://dummy-env.n1eijsdai.eu-west-1.elasticbeanstalk.com
Origin Settings/ Origin Protocol Policy = HTTPS Only
Elastic Beanstalk
Nodejs api (using express)
In beanstalk Environment ID: e-1nasn4, URL: dummy-env.n1eijsdai.eu-west-1.elasticbeanstalk.com
CloudFront serves 504 only if it couldn't either establish TCP connection or the HTTP first byte response took more then what was configured in Origin read/response timeout.
Does your application work directly with beanstalk link or do you have any security group restriction based on IP ?
I had the same issue. I found that the security group in load balancer was not configured.
So I went to. EC2 -> Load Balancers -> select your loadbalancer
Go to Security and add security wizard that was created for EC2 instance.
And you are done.
I'm trying to enable SSL on a subdomain from a domain I purchased from Google Domains (Managed with Netlify DNS). The domain is currently pointing to a static react app hosted by Netlify (it has SSL).
The subdomain (api.example.com) pointing to an elastic IP associated with an EC2 instance doesn't seem to be working when I try to access it with HTTPS (api.example.com’s server IP address could not be found.) but works with HTTP.
Does anyone know of a way I could use that SSL certificate I got from Netlify on the subdomain pointing to my aws instance?
I'm using only an A record for the subdomain -> elastic ip. For the purpose of getting everything to work, I've enabled all inbound/outbound ports for all traffic types on my instance security group.
Our website mywebsite.com is currently managed by Wix DNS. We wanted to create a subdomain api.mywebsite.com to forward requests to aws api gateway. Here are the steps I tried
Created an ACM certificate for *.mywebsite.com
In AWS console API gateway I created a custom domain and associated it with ACM certificated I created about. I got a cloudfront target domain name somecloudfrontid.cloudfront.net
I created a CNAME record in wix that points api.mywebsite.com to somecloudfrontid.cloudfront.net.
But, when I tried to hit api.mywebsite.com I get this error:
ERROR
The request could not be satisfied.
Bad request. Generated by cloudfront (CloudFront)
Am I missing any step? How can I get this working? Do I need to transfer my domain to AWS router 53 to make it work with AWS?
I suggest transferring the domain to Route53. There you can create an alias for your subdomain under Hosted Zones, and point it directly to your cloudfront target domain, as well as several other AWS resources quite easily.
I have EC2 instance created in AWS the ip is for example 54.26.12.***
I have my domain (mydomain.com) registered with S3bucket for this EC2 instance, Now this domain shows the index page provided by AWS.
Now 54.26.12.*** is available while hitting mydomain.com in browser.
In this instance, I deployed a war file to tomcat server and I am able to run this as mydomain.com:8080/myAppUrl.
I am looking for show this application url while hitting mydomain.com in browser.
I can put .htaccess file to rewrite urls. But in AWS I cant do that as it is not supported.
How do I rewrite in AWS to my app for my domain.
Update
domain screen now
you could add a A record on your provider (route53, GoDadddy, NameCheap ...) to point myapp.mydomain.com on your ec2 instance.
On the ec2 instance you would need to run apache to listen on port 80 and forward to your app server the requests.
Otherwise you need to change your current A record on domain.com to point to your ec2 IP address and not the S3 bucket