inhyeeeok / innohi_frontend-react

이노하이 프론트엔드
0 stars 1 forks source link

서브 도메인 추가 시 오류 발생 #63

Closed inhyeeeok closed 2 years ago

inhyeeeok commented 2 years ago

Amazon CloudFront에서 "요청을 충족할 수 없습니다. 잘못된 요청입니다." 오류를 해결하려면 어떻게 해야 합니까? https://aws.amazon.com/ko/premiumsupport/knowledge-center/resolve-cloudfront-bad-request-error/

대체 도메인 이름(CNAME)을 추가하여 파일에 대해 사용자 지정 URL 사용 https://docs.aws.amazon.com/ko_kr/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html#CreatingCNAME

AWS Certificate Manager로 인증서 가져오기 https://docs.aws.amazon.com/ko_kr/acm/latest/userguide/import-certificate.html

inhyeeeok commented 2 years ago

타사 DNS 공급자가 관리하는 사용자 지정 도메인 추가 https://docs.aws.amazon.com/ko_kr/amplify/latest/ug/to-add-a-custom-domain-managed-by-a-third-party-dns-provider.html

inhyeeeok commented 2 years ago

How to Setup Custom Subdomain on AWS Amplify https://www.youtube.com/watch?v=D6PRP2t2Pw8

inhyeeeok commented 2 years ago

타사에서 호스팅하는 도메인이 확인 보류 상태로 고착된 경우 https://docs.aws.amazon.com/ko_kr/amplify/latest/ug/custom-domain-troubleshoot-guide.html#my-domain-hosted-with-a-third-party-is-stuck-in-the-pending-verification-state

inhyeeeok commented 2 years ago

타사 DNS 공급자가 관리하는 사용자 지정 도메인 추가 https://docs.aws.amazon.com/amplify/latest/userguide/to-add-a-custom-domain-managed-by-a-third-party-dns-provider.html

inhyeeeok commented 2 years ago

https://kkangz.github.io/posts/aws_ssl_dnszi/

inhyeeeok commented 2 years ago

직접 문의 했음. AWS에...

inhyeeeok commented 2 years ago

image

inhyeeeok commented 2 years ago

Hello,

Warm Greetings from AWS Premium Support! I am William and I’ll be assisting you with the case.

I understand that you are trying to configure your custom domain innohi.hist.co.kr received an error:

"[AmplifyWaitTimeout] The domain association has failed because we couldn't find the correct CNAME records on the DNS entries of your domain"

Upon using my internal tools, I could not find any Route 53 Hosted Zone, so I assume you are usiong a third-party DNS provider. In order to resolve this issue, you will need to create CNAME record for innohi.hist.co.kr ind point it to the Cloudfront domain name generated by Amplify. To find the domain name generated by Amplify, you can do the following:

  1. Go to Amplify console and select your App.
  2. Click on "Domain management" from the left menu.
  3. On Domain management page, click on "Actions" and select "View DNS records". This will show a small box containing the Cloudfront domain name that you need to configure. it will look like something like this "CNAME xxxxxxx.cloudfront.net" [1].
  4. Copy the Cloudfront domain name and point the CNAME record of innohi.hist.co.kr to this domain. Once that is done, the Domain Activation should be complete.

Note: Once the DNS validation succeeds, this value will not change. The value is from an internal Cloudfront distribution that Amplify creates when setting up a custom domain name.

Can you please check the above steps and see if it helps resolving this DNS issue?

I look forward to hearing from you soon, should you have any further questions or if I misunderstood something, let me know and I will be happy to help. Have a great day ahead!

Have a nice day!

Reference: [1] https://docs.aws.amazon.com/amplify/latest/userguide/to-add-a-custom-domain-managed-by-a-third-party-dns-provider.html

We value your feedback. Please share your experience by rating this correspondence using the AWS Support Center link at the end of this correspondence. Each correspondence can also be rated by selecting the stars in top right corner of each correspondence within the AWS Support Center.

Best regards, William S. Amazon Web Services

===============================================================

To share your experience or contact us again about this case, please return to the AWS Support Center using the following URL: https://console.aws.amazon.com/support/home#/case/?displayId=10002386701&language=en

Note, this e-mail was sent from an address that cannot accept incoming e-mails. To respond to this case, please follow the link above to respond from your AWS Support Center.

===============================================================

Don’t miss messages from AWS Support when you need help! Update your contact information: https://console.aws.amazon.com/billing/home#/account

If you receive an error message when visiting the contact information page, visit: https://aws.amazon.com/premiumsupport/knowledge-center/iam-billing-access/

AWS Support: https://aws.amazon.com/premiumsupport/knowledge-center/

AWS Documentation: https://docs.aws.amazon.com/

AWS Cost Management: https://aws.amazon.com/aws-cost-management/

AWS Training: http://aws.amazon.com/training/

AWS Managed Services: https://aws.amazon.com/managed-services/

inhyeeeok commented 2 years ago

Thank you for answer.

as you said, i using a third-party DNS provider.

So I did what you said

  1. On Domain management page, click on "Actions" and select "View DNS records". This will show a small box containing the Cloudfront domain name that you need to configure. it will look like something like this "CNAME xxxxxxx.cloudfront.net" [1].

but it's delayed can you confirm? innohi.hist.co.kr

inhyeeeok commented 2 years ago

Hello there,

I can see that the DNS innohi.hist.co.kr has been propagated as I could access the site. However, when I try to access, I receive a 403 Error from Cloudfront.

In order to further investigate this, I kindly ask you to provide the following:

I will patiently wait for your response, in a meantime, feel free to reach me out if you have any additional concerns and I will be glad to assist you with my best.

Wish you an excellent day!

We value your feedback. Please share your experience by rating this correspondence using the AWS Support Center link at the end of this correspondence. Each correspondence can also be rated by selecting the stars in top right corner of each correspondence within the AWS Support Center.

Best regards, William S. Amazon Web Services

===============================================================

To share your experience or contact us again about this case, please return to the AWS Support Center using the following URL: https://console.aws.amazon.com/support/home#/case/?displayId=10002386701&language=en

Note, this e-mail was sent from an address that cannot accept incoming e-mails. To respond to this case, please follow the link above to respond from your AWS Support Center.

===============================================================

Don’t miss messages from AWS Support when you need help! Update your contact information: https://console.aws.amazon.com/billing/home#/account

If you receive an error message when visiting the contact information page, visit: https://aws.amazon.com/premiumsupport/knowledge-center/iam-billing-access/

AWS Support: https://aws.amazon.com/premiumsupport/knowledge-center/

AWS Documentation: https://docs.aws.amazon.com/

AWS Cost Management: https://aws.amazon.com/aws-cost-management/

AWS Training: http://aws.amazon.com/training/

AWS Managed Services: https://aws.amazon.com/managed-services/

inhyeeeok commented 2 years ago

thanks for the kind reply Please review my answer here.

  1. What is the Application ID? Is it "dxtribtwfr2oa" the application in question?

    • Yes
  2. Is it working with the default DNS that Amplify creates for you, working? Example: https://BRANCH_NAME.APP_ID.amplifyapp.com

  3. Are you using a Server Side Rendering (SSR) application, like NextJS?

    • No. I am just making an application with react.
inhyeeeok commented 2 years ago

Hello,

Thank you for providing all the requested information.

I can see you are not completely satisfied with my last correspondence. Apologies if I have misunderstood something, rest assured I will do my best to help resolving this issue.

I did more investigations on my side, and the custom domain association seems correct. By running a "dig NS innohi.hist.co.kr" I could see that innohi.hist.co.kr is pointing to the Cloudfront domain name distribution:

innohi.hist.co.kr. 3600 IN CNAME d31jyj5qee55b8.cloudfront.net. d31jyj5qee55b8.cloudfront.net. 1831 IN NS ns-163.awsdns-20.com. d31jyj5qee55b8.cloudfront.net. 1831 IN NS ns-591.awsdns-09.net. d31jyj5qee55b8.cloudfront.net. 1831 IN NS ns-1361.awsdns-42.org. d31jyj5qee55b8.cloudfront.net. 1831 IN NS ns-1560.awsdns-03.co.uk.

However, one thing that might be missing is the step to configure a CNAME to point to the AWS validation server. Amplify uses this information to verify ownership of your domain and generate an SSL/TLS certificate for your domain. When I access innohi.hist.co.kr, the connection is not secure (see screenshot).

The setup can can be slightly different depending on the DNS Provider. For GoDaddy [1] and Google [2] is the step 5, Google whereas for other DNS provider [3] is step 10.

For third-party DNS providers: “ If the validation server is _cjhwou20vhu2exampleuw20vuyb2ovb9.j9s73ucn9vy.acm-validations.aws, enter _cjhwou20vhu2exampleuw20vuyb2ovb9.j9s73ucn9vy.acm-validations.aws. Once Amplify validates ownership of your domain, all traffic will be served using HTTPS/2. “

Can you please check the above step to configure a CNAME pointing to the AWS validation server and see if it helps resolving your issue? Note: If you would like, we can do a live troubleshooting session together. I’m located in Dublin (UTC +1) and my availability is 10am to 3pm. Please let me know a suitable time frame for you.

Please don’t hesitate to follow up with any questions you have and I will be happy to help.

Have a nice day!

References: [1] https://docs.aws.amazon.com/amplify/latest/userguide/to-add-a-custom-domain-managed-by-godaddy.html [2] https://docs.aws.amazon.com/amplify/latest/userguide/to-add-a-custom-domain-managed-by-google-domains.html [3] https://docs.aws.amazon.com/amplify/latest/userguide/to-add-a-custom-domain-managed-by-a-third-party-dns-provider.html

To see the file named 'connection-not-secure.png' included with this correspondence, please use the case link given below the signature.

We value your feedback. Please share your experience by rating this correspondence using the AWS Support Center link at the end of this correspondence. Each correspondence can also be rated by selecting the stars in top right corner of each correspondence within the AWS Support Center.

Best regards, William S. Amazon Web Services

===============================================================

To share your experience or contact us again about this case, please return to the AWS Support Center using the following URL: https://console.aws.amazon.com/support/home#/case/?displayId=10002386701&language=en

Note, this e-mail was sent from an address that cannot accept incoming e-mails. To respond to this case, please follow the link above to respond from your AWS Support Center.

===============================================================

Don’t miss messages from AWS Support when you need help! Update your contact information: https://console.aws.amazon.com/billing/home#/account

If you receive an error message when visiting the contact information page, visit: https://aws.amazon.com/premiumsupport/knowledge-center/iam-billing-access/

AWS Support: https://aws.amazon.com/premiumsupport/knowledge-center/

AWS Documentation: https://docs.aws.amazon.com/

AWS Cost Management: https://aws.amazon.com/aws-cost-management/

AWS Training: http://aws.amazon.com/training/

AWS Managed Services: https://aws.amazon.com/managed-services/

connection-not-secure
inhyeeeok commented 2 years ago

image image

AWS ACM에 인증서를 등록해야 AWS가 찾아서 유효성 검증을 할수 있었음 등록 완료 그 이후로 https://innohi.hist.co.kr/ 에 접근 하였으나 접근 할수가 없다고 나옴.

inhyeeeok commented 2 years ago

Hello there,

This is William again, thank you for the updates.

I investigated on my side, and can see that you are using a redirect rule to redirect the traffic from https://innohi.hist.co.kr/ to https://www.innohi.hist.co.kr/ . However, upon using my internal tools, the same is not added in your Amplify configuration. Please check this link to see how the innohi.hist.co.kr [1] resolves and www.innohi.hist.co.kr does not [2].

Therefore, that is the reason why it is not resolving. To sort this issue, you have two solutions:

Can you please try the above steps and let me know the results?

Thanks for all you collaboration with this investigation, I'm looking forward to your reply. Should you have any further questions, let me know and I will be happy to help.

Wish you an excellent day!

References: [1] https://www.whatsmydns.net/#CNAME/innohi.hist.co.kr [2] https://www.whatsmydns.net/#CNAME/www.innohi.hist.co.kr

We value your feedback. Please share your experience by rating this correspondence using the AWS Support Center link at the end of this correspondence. Each correspondence can also be rated by selecting the stars in top right corner of each correspondence within the AWS Support Center.

Best regards, William S. Amazon Web Services

===============================================================

To share your experience or contact us again about this case, please return to the AWS Support Center using the following URL: https://console.aws.amazon.com/support/home#/case/?displayId=10002386701&language=en

Note, this e-mail was sent from an address that cannot accept incoming e-mails. To respond to this case, please follow the link above to respond from your AWS Support Center.

===============================================================

Don’t miss messages from AWS Support when you need help! Update your contact information: https://console.aws.amazon.com/billing/home#/account

If you receive an error message when visiting the contact information page, visit: https://aws.amazon.com/premiumsupport/knowledge-center/iam-billing-access/

AWS Support: https://aws.amazon.com/premiumsupport/knowledge-center/

AWS Documentation: https://docs.aws.amazon.com/

AWS Cost Management: https://aws.amazon.com/aws-cost-management/

AWS Training: http://aws.amazon.com/training/

AWS Managed Services: https://aws.amazon.com/managed-services/

inhyeeeok commented 2 years ago

Hello there,

Thank you for the updates and screenshots.

I’m sorry to hear that the solutions did not work, rest assured I will do my best to help you to get this custom domain name working.

The redirect seems correct, however by using my internal tools, I still cannot see the domain www.innohi.hist.co.kr associated with Amplify Cloudfront distribution, just innohi.hist.co.kr.

The innohi.hist.co.kr resolves: ❯ dig +short innohi.hist.co.kr d2u517g2akp1v7.cloudfront.net. 108.157.4.6 108.157.4.53 108.157.4.67 108.157.4.81

Whereas www.innohi.hist.co.kr does not: ❯ dig +short www.innohi.hist.co.kr (http://www.innohi.hist.co.kr/)

To simplify, let's just keep the following redirects rules in your application:

/<*> /index.html 404-200 null </^[^.]+$|.(?!(css|gif|ico|jpg|js|png|txt|svg|woff|ttf|map|json)$)([^.]+$)/> /index.html 200 null

This way, when you type innohi.hist.co.kr is should not redirect to www.innohi.hist.co.kr, and it should work as expected.

Can you please remove the other redirects and let me know if you can access innohi.hist.co.kr? Then, we can work together to make the www.innohi.hist.co.kr working.

Thank you and I look forward your reply, please let me know if you have any questions.

Have a nice day!

We value your feedback. Please share your experience by rating this correspondence using the AWS Support Center link at the end of this correspondence. Each correspondence can also be rated by selecting the stars in top right corner of each correspondence within the AWS Support Center.

Best regards, William S. Amazon Web Services

===============================================================

To share your experience or contact us again about this case, please return to the AWS Support Center using the following URL: https://console.aws.amazon.com/support/home#/case/?displayId=10002386701&language=en

Note, this e-mail was sent from an address that cannot accept incoming e-mails. To respond to this case, please follow the link above to respond from your AWS Support Center.

===============================================================

Don’t miss messages from AWS Support when you need help! Update your contact information: https://console.aws.amazon.com/billing/home#/account

If you receive an error message when visiting the contact information page, visit: https://aws.amazon.com/premiumsupport/knowledge-center/iam-billing-access/

AWS Support: https://aws.amazon.com/premiumsupport/knowledge-center/

AWS Documentation: https://docs.aws.amazon.com/

AWS Cost Management: https://aws.amazon.com/aws-cost-management/

AWS Training: http://aws.amazon.com/training/

AWS Managed Services: https://aws.amazon.com/managed-services/