{"id":364303,"date":"2024-05-21T02:14:16","date_gmt":"2024-05-21T02:14:16","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=364303"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=364303","title":{"rendered":"<span>\u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0430\u0439\u0442 \u043d\u0430 AWS \u0441 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u043c http\u2192https, www.site\u2192site<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430<\/strong><\/p>\n<p>\u0415\u0441\u0442\u044c AWS \u0430\u043a\u043a\u0430\u0443\u043d\u0442, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0430\u0439\u0442 (html, js, css, png, jpg) \u043d\u0430 \u0441\u0432\u043e\u0451\u043c \u0434\u043e\u043c\u0435\u043d\u0435 <a href=\"http:\/\/example.com\" rel=\"noopener noreferrer nofollow\">example.com<\/a>.<\/p>\n<p>\u0421\u0441\u044b\u043b\u043a\u0438: <a href=\"http:\/\/example.com\" rel=\"noopener noreferrer nofollow\">http:\/\/example.com<\/a>, <a href=\"http:\/\/www.example.com\" rel=\"noopener noreferrer nofollow\">http:\/\/www.example.com<\/a>, <a href=\"https:\/\/www.example.com\" rel=\"noopener noreferrer nofollow\">https:\/\/www.example.com<\/a> \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0430\u0439\u0442 <a href=\"https:\/\/example.com\" rel=\"noopener noreferrer nofollow\">https:\/\/example.com<\/a>.<\/p>\n<p><strong>\u041f\u043b\u0430\u043d \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439<\/strong><\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u043a\u0443\u043f\u043a\u0430 \u0434\u043e\u043c\u0435\u043d\u0430<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u043f\u0443\u0441\u043a SSL \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043b\u0438\u0432\u043a\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 html, js, css \u0432 S3.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 CloudFront distributions (\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0438 \u0434\u043b\u044f \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0430 \u0441 www)<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438\u0432\u044f\u0437\u043a\u0430 CloudFront \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0430 \u043a CloudFront distribution<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 A-\u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 DNS<\/p>\n<\/li>\n<\/ul>\n<h4>\u041f\u043e\u043a\u0443\u043f\u043a\u0430 \u0434\u043e\u043c\u0435\u043d\u0430<\/h4>\n<p><a href=\"https:\/\/console.aws.amazon.com\/route53\/v2\/home\" rel=\"noopener noreferrer nofollow\">Route 53<\/a> \u2192 <a href=\"https:\/\/console.aws.amazon.com\/route53\/domains\/home#\/\" rel=\"noopener noreferrer nofollow\">Registered domains<\/a> \u2192 <a href=\"https:\/\/console.aws.amazon.com\/route53\/domains\/home#\/DomainSearch\" rel=\"noopener noreferrer nofollow\">Register domains<\/a><br \/>\u0418\u0449\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0439 \u0434\u043e\u043c\u0435\u043d example.com, \u043e\u043f\u043b\u0430\u0447\u0438\u0432\u0430\u0435\u043c. \u0414\u043e\u043c\u0435\u043d \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 <a href=\"https:\/\/console.aws.amazon.com\/route53\/domains\/home#\/\" rel=\"noopener noreferrer nofollow\">Registered domains<\/a>.<br \/>\u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 <a href=\"https:\/\/console.aws.amazon.com\/route53\/v2\/home\" rel=\"noopener noreferrer nofollow\">Route 53<\/a> \u2192 <a href=\"https:\/\/console.aws.amazon.com\/route53\/v2\/hostedzones#\" rel=\"noopener noreferrer nofollow\">Hosted zones<\/a> \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 hosted zone \u0434\u043b\u044f \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u0434\u043e\u043c\u0435\u043d\u0430 example.com \u0441 DNS \u0437\u0430\u043f\u0438\u0441\u044f\u043c\u0438 NS \u0438 SOA.<\/p>\n<h4>\u0412\u044b\u043f\u0443\u0441\u043a SSL \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430<\/h4>\n<p>\u0412\u044b\u043f\u0443\u0441\u043a\u0430\u0435\u043c Amazon issued SSL certificate \u0434\u043b\u044f \u0434\u0432\u0443\u0445 \u0434\u043e\u043c\u0435\u043d\u043e\u0432: <a href=\"http:\/\/example.com\" rel=\"noopener noreferrer nofollow\">example.com<\/a> \u0438 <a href=\"http:\/\/www.example.com\" rel=\"noopener noreferrer nofollow\">www.example.com<\/a>.<br \/><a href=\"https:\/\/console.aws.amazon.com\/acm\/home\" rel=\"noopener noreferrer nofollow\">AWS Certificate Manager<\/a> \u2192 <a href=\"https:\/\/console.aws.amazon.com\/acm\/home#\/certificates\/list\" rel=\"noopener noreferrer nofollow\">Certificates<\/a> \u2192 <a href=\"https:\/\/console.aws.amazon.com\/acm\/home#\/certificates\/request\" rel=\"noopener noreferrer nofollow\">Request certificate<\/a><br \/>Request a public certificate, Next.<br \/>Fully qualified domain name: example.com<br \/>\u041d\u0430\u0436\u0430\u0442\u044c Add another name to this certificate. \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c www.example.com<br \/>Validation method: DNS validation &#8212; recommended<br \/>\u041d\u0430\u0436\u0430\u0442\u044c Request.<br \/>View certificate. \u041d\u0430\u0436\u0430\u0442\u044c Create records in Route 53.<br \/>\u0412 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0438\u043d\u0443\u0442 \u0441\u0442\u0430\u0442\u0443\u0441 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 Issued. \u041e\u043d \u0431\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0435\u0440\u0435\u0432\u044b\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0438\u0441\u0442\u0435\u0447\u0435\u043d\u0438\u044f \u0441\u0440\u043e\u043a\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f (\u0433\u043e\u0434).<\/p>\n<h4>\u0417\u0430\u043b\u0438\u0432\u043a\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 S3<\/h4>\n<p><a href=\"https:\/\/s3.console.aws.amazon.com\/s3\/home\" rel=\"noopener noreferrer nofollow\">S3<\/a> \u2192 <a href=\"https:\/\/s3.console.aws.amazon.com\/s3\/bucket\/create\" rel=\"noopener noreferrer nofollow\">Create bucket<\/a>.<br \/>Bucket name: example-com (\u0442\u043e\u0447\u043a\u0438 \u043c\u0435\u043d\u044f\u0435\u043c \u043d\u0430 \u0434\u0435\u0444\u0438\u0441)<br \/>AWS Region: \u043b\u044e\u0431\u043e\u0439 \u043f\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u044e.<br \/>\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c Block all public access. (\u041f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0444\u0430\u0439\u043b\u0430\u043c \u0432 S3 \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f, AWS \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u0430)<br \/>\u041d\u0430\u0436\u0430\u0442\u044c Create bucket.<br \/>\u0412 \u043a\u043e\u0440\u0435\u043d\u044c \u0431\u0430\u043a\u0435\u0442\u0430 \u0437\u0430\u043b\u0438\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b index.html \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u0430\u0439\u043b\u044b \u043b\u044e\u0431\u044b\u043c \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c (\u043f\u0435\u0440\u0435\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u043d\u0438\u0435\u043c \u0438\u043b\u0438 <a href=\"https:\/\/aws.amazon.com\/cli\/\" rel=\"noopener noreferrer nofollow\">AWS CLI<\/a>, \u0435\u0441\u043b\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u043c\u043d\u043e\u0433\u043e \u0438\u043b\u0438 \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0430\u043f\u043e\u043a) \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<h4>CloudFront distribution \u0434\u043b\u044f example.com<\/h4>\n<p><a href=\"https:\/\/console.aws.amazon.com\/cloudfront\/v4\/home\" rel=\"noopener noreferrer nofollow\">CloudFront<\/a> \u2192 <a href=\"https:\/\/console.aws.amazon.com\/cloudfront\/v4\/home#\/distributions\" rel=\"noopener noreferrer nofollow\">Distributions<\/a> \u2192 <a href=\"https:\/\/console.aws.amazon.com\/cloudfront\/v4\/home#\/distributions\/create\" rel=\"noopener noreferrer nofollow\">Create distribution<\/a><br \/>Origin domain: \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 <a href=\"http:\/\/example-com.s3.amazonaws.com\" rel=\"noopener noreferrer nofollow\">example-com.s3.amazonaws.com<\/a> (\u044d\u0442\u043e S3 \u0431\u0430\u043a\u0435\u0442, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0448\u0430\u0433\u0435).<br \/>Origin access: Origin access control settings (recommended)<br \/>\u041d\u0430\u0436\u0430\u0442\u044c Create control setting. \u041d\u0430\u0436\u0430\u0442\u044c Create. \u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0435\u0433\u043e \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430.<br \/>\u041f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435: You must update the S3 bucket policy<br \/>Viewer protocol policy: <strong>Redirect HTTP to HTTPS<\/strong> (\u0434\u043b\u044f \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0430 <a href=\"http:\/\/example.com\" rel=\"noopener noreferrer nofollow\">http:\/\/example.com<\/a> \u2192 <a href=\"https:\/\/example.com\" rel=\"noopener noreferrer nofollow\">https:\/\/example.com<\/a>)<br \/>\u041e\u0442\u043c\u0435\u0442\u0438\u0442\u044c Do not enable security protections<br \/>Price class: \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u043f\u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0443 \u0446\u0435\u043d\u0430\/\u0432\u0440\u0435\u043c\u044f \u043e\u0442\u043a\u043b\u0438\u043a\u0430.<br \/>Alternate domain name (CNAME) \u2192 Add item \u2192 <strong>example.com<\/strong><br \/>Custom SSL certificate: \u0412\u044b\u0431\u0440\u0430\u0442\u044c SSL \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430.<br \/>Default root object: <strong>index.html<\/strong><br \/>\u041d\u0430\u0436\u0430\u0442\u044c Create distribution.<\/p>\n<h4>CloudFront \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0430 www.example.com \u2192 example.com<\/h4>\n<p><a href=\"https:\/\/docs.aws.amazon.com\/AmazonCloudFront\/latest\/DeveloperGuide\/cloudfront-functions.html\" rel=\"noopener noreferrer nofollow\">CloudFront Functions<\/a> \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u0432 2021\u0433. \u043a\u0430\u043a \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0438 \u0434\u0435\u0448\u0451\u0432\u0430\u044f \u0437\u0430\u043c\u0435\u043d\u0430 <a href=\"https:\/\/aws.amazon.com\/lambda\/edge\/\" rel=\"noopener noreferrer nofollow\"><u>Lambda@Edge<\/u><\/a> \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 HTTP \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0438 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432. \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0432\u043e \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c CloudFront distribution (www.example.com) \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0448\u0430\u0433\u0435. \u041a\u043e\u0433\u0434\u0430 \u0431\u0440\u0430\u0437\u0435\u0440 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0438\u0437 distribution, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u0430 \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043e\u043d\u0430 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e, \u0431\u0435\u0437 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0444\u0430\u0439\u043b\u0430\u043c \u0432 S3, \u0432\u0435\u0440\u043d\u0451\u0442 HTTP \u043e\u0442\u0432\u0435\u0442 \u0441 \u043a\u043e\u0434\u043e\u043c 301 (Permanently Moved) \u0438 \u043d\u043e\u0432\u044b\u043c URL, https:\/\/example.com.<\/p>\n<p><a href=\"https:\/\/console.aws.amazon.com\/cloudfront\/v4\/home\" rel=\"noopener noreferrer nofollow\">CloudFront<\/a> \u2192 <a href=\"https:\/\/console.aws.amazon.com\/cloudfront\/v3\/home#\/functions\" rel=\"noopener noreferrer nofollow\">Functions<\/a> \u2192 <a href=\"https:\/\/console.aws.amazon.com\/cloudfront\/v3\/home#\/functions\/create\" rel=\"noopener noreferrer nofollow\">Create function<\/a><br \/>Name: Redirect-www-example-com<br \/>Description: Redirect www.example.com to https:\/\/example.com<br \/>\u041d\u0430\u0436\u0430\u0442\u044c Create function.<br \/>\u041d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 Development \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 \u0442\u0430\u043a\u043e\u0439, \u0438\u0437\u043c\u0435\u043d\u0438\u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0430 <code>location<\/code> \u043d\u0430 \u0441\u0432\u043e\u0439 \u0434\u043e\u043c\u0435\u043d:<\/p>\n<pre><code class=\"javascript\">function handler(event) {     \/\/ NOTE: This example function is for a viewer request event trigger.      \/\/ Choose viewer request for event trigger when you associate this function with a distribution.      var response = {         statusCode: 301,         statusDescription: 'Moved Permanently',         headers: {             'cloudfront-functions': { value: 'generated-by-CloudFront-Functions' },             'location': { value: 'https:\/\/example.com' }         }     };     return response; } <\/code><\/pre>\n<p>\u041d\u0430\u0436\u0430\u0442\u044c Save changes. \u0412\u043a\u043b\u0430\u0434\u043a\u0430 Publish \u2192 \u043a\u043d\u043e\u043f\u043a\u0430 Publish function.<\/p>\n<h4>CloudFront distribution \u0434\u043b\u044f \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0430 www.example.com \u2192 example.com<\/h4>\n<p><a href=\"https:\/\/console.aws.amazon.com\/cloudfront\/v4\/home\" rel=\"noopener noreferrer nofollow\">CloudFront<\/a> \u2192 <a href=\"https:\/\/console.aws.amazon.com\/cloudfront\/v4\/home#\/distributions\" rel=\"noopener noreferrer nofollow\">Distributions<\/a> \u2192 <a href=\"https:\/\/console.aws.amazon.com\/cloudfront\/v4\/home#\/distributions\/create\" rel=\"noopener noreferrer nofollow\">Create distribution<\/a><br \/>Origin domain: \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 <a href=\"http:\/\/example-com.s3.amazonaws.com\" rel=\"noopener noreferrer nofollow\">example-com.s3.amazonaws.com<\/a> (\u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u0432\u0430\u0436\u043d\u043e, \u0442.\u043a. \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442).<br \/>Origin access: Origin access control settings (recommended)<br \/>Origin access control: \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439.<br \/>Viewer protocol policy: <strong>HTTP and HTTPS<\/strong><br \/>\u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 Function associations, \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 Viewer request \u0432\u044b\u0431\u0440\u0430\u0442\u044c CloudFront Functions, \u0432\u044b\u0431\u0440\u0430\u0442\u044c Redirect-www-example-com (\u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0448\u0430\u0433\u0435)<br \/>\u041e\u0442\u043c\u0435\u0442\u0438\u0442\u044c Do not enable security protections<br \/>Price class: \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u043f\u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0443 \u0446\u0435\u043d\u0430\/\u0432\u0440\u0435\u043c\u044f \u043e\u0442\u043a\u043b\u0438\u043a\u0430.<br \/>Alternate domain name (CNAME) \u2192 Add item \u2192 <strong>www.example.com<\/strong><br \/>Custom SSL certificate: \u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0442\u043e\u0442 \u0436\u0435 SSL \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430.<br \/>Default root object: \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u043c (\u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f).<br \/>\u041d\u0430\u0436\u0430\u0442\u044c Create distribution.<br \/>\u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f distribution \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0431\u0443\u0444\u0435\u0440 \u0442\u0435\u043a\u0441\u0442 policy \u0434\u043b\u044f S3.<br \/>\u0422\u0435\u043a\u0441\u0442 policy \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 <a href=\"https:\/\/s3.console.aws.amazon.com\/s3\/home\" rel=\"noopener noreferrer nofollow\">S3<\/a> \u2192 example-com \u2192 Permissions \u2192 Bucket policy.<\/p>\n<h4>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 A-\u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u043b\u044f example.com<\/h4>\n<p><a href=\"https:\/\/console.aws.amazon.com\/route53\/v2\/home\" rel=\"noopener noreferrer nofollow\">Route 53<\/a> \u2192 <a href=\"https:\/\/us-east-1.console.aws.amazon.com\/route53\/v2\/hostedzones\" rel=\"noopener noreferrer nofollow\">Hosted zones<\/a> \u2192 example.com<br \/>Create record.<br \/>Record name: example.com (\u043f\u043e\u043b\u0435 \u0432\u0432\u043e\u0434\u0430 subdomain &#8212; \u043f\u0443\u0441\u0442\u043e\u0435)<br \/>Record type: A.<br \/>Alias: Yes.<br \/>Route traffic to: Alias to CloudFront distribution.<br \/>Choose distribution: example.com (*.cloudfront.net).<br \/>\u041d\u0430\u0436\u0430\u0442\u044c Create records.<\/p>\n<h4>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 A-\u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u043b\u044f www.example.com<\/h4>\n<p><a href=\"https:\/\/console.aws.amazon.com\/route53\/v2\/home\" rel=\"noopener noreferrer nofollow\">Route 53<\/a> \u2192 <a href=\"https:\/\/us-east-1.console.aws.amazon.com\/route53\/v2\/hostedzones\" rel=\"noopener noreferrer nofollow\">Hosted zones<\/a> \u2192 example.com<br \/>Create record.<br \/>Record name: www.example.com (\u0432 \u043f\u043e\u043b\u0435 \u0432\u0432\u043e\u0434\u0430 subdomain \u0432\u043f\u0438\u0441\u0430\u0442\u044c <code>www<\/code>)<br \/>Record type: A.<br \/>Alias: Yes.<br \/>Route traffic to: Alias to CloudFront distribution.<br \/>Choose distribution: www.example.com (*.cloudfront.net).<br \/>\u041d\u0430\u0436\u0430\u0442\u044c Create records.<br \/>\u041e\u0431\u044b\u0447\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0438 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u044b \u043c\u0438\u043d\u0443\u0442.<\/p>\n<h4>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h4>\n<p>\u0421\u0430\u0439\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435 <a href=\"https:\/\/example.com\" rel=\"noopener noreferrer nofollow\">https:\/\/example.com<\/a>.<br \/>CloudFront \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0443\u044e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0444\u0430\u0439\u043b\u043e\u0432 \u0441\u0430\u0439\u0442\u0430 \u043f\u0440\u0438 \u043b\u044e\u0431\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0435. \u041e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f.<br \/>\u0421\u0441\u044b\u043b\u043a\u0438 <a href=\"http:\/\/www.example.com\" rel=\"noopener noreferrer nofollow\">http:\/\/www.example.com<\/a>, <a href=\"https:\/\/www.example.com\" rel=\"noopener noreferrer nofollow\">https:\/\/www.example.com<\/a>, <a href=\"http:\/\/example.com\" rel=\"noopener noreferrer nofollow\">http:\/\/example.com<\/a> \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442 (HTTP code 301) \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0430\u0439\u0442 <a href=\"https:\/\/example.com\" rel=\"noopener noreferrer nofollow\">https:\/\/example.com<\/a>.<br \/>\u041e\u0431\u0440\u0430\u0442\u043d\u043e\u0435 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 (<a href=\"http:\/\/example.com\" rel=\"noopener noreferrer nofollow\">example.com<\/a> \u2192 <a href=\"http:\/\/www.example.com\" rel=\"noopener noreferrer nofollow\">www.example.com<\/a>) \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0445\u043e\u0436\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<p>\u0422\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0445\u043e\u0441\u0442\u0438\u043d\u0433\u0430 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u043d\u0435\u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439. \u041f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0442\u044f\u0436\u0451\u043b\u043e\u0439 \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0438 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u0430\u044f \u0446\u0435\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0432\u044b\u0441\u043e\u043a\u043e\u0432\u0430\u0442\u0430 \u0438 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0434\u0443\u043c\u0430\u0442\u044c\u0441\u044f \u043e\u0431 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430\u0445.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/783910\/\"> https:\/\/habr.com\/ru\/articles\/783910\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><strong>\u0417\u0430\u0434\u0430\u0447\u0430<\/strong><\/p>\n<p>\u0415\u0441\u0442\u044c AWS \u0430\u043a\u043a\u0430\u0443\u043d\u0442, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0430\u0439\u0442 (html, js, css, png, jpg) \u043d\u0430 \u0441\u0432\u043e\u0451\u043c \u0434\u043e\u043c\u0435\u043d\u0435 <a href=\"http:\/\/example.com\" rel=\"noopener noreferrer nofollow\">example.com<\/a>.<\/p>\n<p>\u0421\u0441\u044b\u043b\u043a\u0438: <a href=\"http:\/\/example.com\" rel=\"noopener noreferrer nofollow\">http:\/\/example.com<\/a>, <a href=\"http:\/\/www.example.com\" rel=\"noopener noreferrer nofollow\">http:\/\/www.example.com<\/a>, <a href=\"https:\/\/www.example.com\" rel=\"noopener noreferrer nofollow\">https:\/\/www.example.com<\/a> \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0430\u0439\u0442 <a href=\"https:\/\/example.com\" rel=\"noopener noreferrer nofollow\">https:\/\/example.com<\/a>.<\/p>\n<p><strong>\u041f\u043b\u0430\u043d \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439<\/strong><\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u043a\u0443\u043f\u043a\u0430 \u0434\u043e\u043c\u0435\u043d\u0430<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u043f\u0443\u0441\u043a SSL \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043b\u0438\u0432\u043a\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 html, js, css \u0432 S3.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 CloudFront distributions (\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0438 \u0434\u043b\u044f \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0430 \u0441 www)<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438\u0432\u044f\u0437\u043a\u0430 CloudFront \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0430 \u043a CloudFront distribution<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 A-\u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 DNS<\/p>\n<\/li>\n<\/ul>\n<h4>\u041f\u043e\u043a\u0443\u043f\u043a\u0430 \u0434\u043e\u043c\u0435\u043d\u0430<\/h4>\n<p><a href=\"https:\/\/console.aws.amazon.com\/route53\/v2\/home\" rel=\"noopener noreferrer nofollow\">Route 53<\/a> \u2192 <a href=\"https:\/\/console.aws.amazon.com\/route53\/domains\/home#\/\" rel=\"noopener noreferrer nofollow\">Registered domains<\/a> \u2192 <a href=\"https:\/\/console.aws.amazon.com\/route53\/domains\/home#\/DomainSearch\" rel=\"noopener noreferrer nofollow\">Register domains<\/a><br \/>\u0418\u0449\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0439 \u0434\u043e\u043c\u0435\u043d example.com, \u043e\u043f\u043b\u0430\u0447\u0438\u0432\u0430\u0435\u043c. \u0414\u043e\u043c\u0435\u043d \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 <a href=\"https:\/\/console.aws.amazon.com\/route53\/domains\/home#\/\" rel=\"noopener noreferrer nofollow\">Registered domains<\/a>.<br \/>\u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 <a href=\"https:\/\/console.aws.amazon.com\/route53\/v2\/home\" rel=\"noopener noreferrer nofollow\">Route 53<\/a> \u2192 <a href=\"https:\/\/console.aws.amazon.com\/route53\/v2\/hostedzones#\" rel=\"noopener noreferrer nofollow\">Hosted zones<\/a> \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 hosted zone \u0434\u043b\u044f \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u0434\u043e\u043c\u0435\u043d\u0430 example.com \u0441 DNS \u0437\u0430\u043f\u0438\u0441\u044f\u043c\u0438 NS \u0438 SOA.<\/p>\n<h4>\u0412\u044b\u043f\u0443\u0441\u043a SSL \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430<\/h4>\n<p>\u0412\u044b\u043f\u0443\u0441\u043a\u0430\u0435\u043c Amazon issued SSL certificate \u0434\u043b\u044f \u0434\u0432\u0443\u0445 \u0434\u043e\u043c\u0435\u043d\u043e\u0432: <a href=\"http:\/\/example.com\" rel=\"noopener noreferrer nofollow\">example.com<\/a> \u0438 <a href=\"http:\/\/www.example.com\" rel=\"noopener noreferrer nofollow\">www.example.com<\/a>.<br \/><a href=\"https:\/\/console.aws.amazon.com\/acm\/home\" rel=\"noopener noreferrer nofollow\">AWS Certificate Manager<\/a> \u2192 <a href=\"https:\/\/console.aws.amazon.com\/acm\/home#\/certificates\/list\" rel=\"noopener noreferrer nofollow\">Certificates<\/a> \u2192 <a href=\"https:\/\/console.aws.amazon.com\/acm\/home#\/certificates\/request\" rel=\"noopener noreferrer nofollow\">Request certificate<\/a><br \/>Request a public certificate, Next.<br \/>Fully qualified domain name: example.com<br \/>\u041d\u0430\u0436\u0430\u0442\u044c Add another name to this certificate. \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c www.example.com<br \/>Validation method: DNS validation &#8212; recommended<br \/>\u041d\u0430\u0436\u0430\u0442\u044c Request.<br \/>View certificate. \u041d\u0430\u0436\u0430\u0442\u044c Create records in Route 53.<br \/>\u0412 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0438\u043d\u0443\u0442 \u0441\u0442\u0430\u0442\u0443\u0441 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 Issued. \u041e\u043d \u0431\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0435\u0440\u0435\u0432\u044b\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0438\u0441\u0442\u0435\u0447\u0435\u043d\u0438\u044f \u0441\u0440\u043e\u043a\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f (\u0433\u043e\u0434).<\/p>\n<h4>\u0417\u0430\u043b\u0438\u0432\u043a\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 S3<\/h4>\n<p><a href=\"https:\/\/s3.console.aws.amazon.com\/s3\/home\" rel=\"noopener noreferrer nofollow\">S3<\/a> \u2192 <a href=\"https:\/\/s3.console.aws.amazon.com\/s3\/bucket\/create\" rel=\"noopener noreferrer nofollow\">Create bucket<\/a>.<br \/>Bucket name: example-com (\u0442\u043e\u0447\u043a\u0438 \u043c\u0435\u043d\u044f\u0435\u043c \u043d\u0430 \u0434\u0435\u0444\u0438\u0441)<br \/>AWS Region: \u043b\u044e\u0431\u043e\u0439 \u043f\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u044e.<br \/>\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c Block all public access. (\u041f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0444\u0430\u0439\u043b\u0430\u043c \u0432 S3 \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f, AWS \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u0430)<br \/>\u041d\u0430\u0436\u0430\u0442\u044c Create bucket.<br \/>\u0412 \u043a\u043e\u0440\u0435\u043d\u044c \u0431\u0430\u043a\u0435\u0442\u0430 \u0437\u0430\u043b\u0438\u0432\u0430\u0435\u043c \u0444\u0430\u0439\u043b index.html \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u0430\u0439\u043b\u044b \u043b\u044e\u0431\u044b\u043c \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c (\u043f\u0435\u0440\u0435\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u043d\u0438\u0435\u043c \u0438\u043b\u0438 <a href=\"https:\/\/aws.amazon.com\/cli\/\" rel=\"noopener noreferrer nofollow\">AWS CLI<\/a>, \u0435\u0441\u043b\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u043c\u043d\u043e\u0433\u043e \u0438\u043b\u0438 \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0430\u043f\u043e\u043a) \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<h4>CloudFront distribution \u0434\u043b\u044f example.com<\/h4>\n<p><a href=\"https:\/\/console.aws.amazon.com\/cloudfront\/v4\/home\" rel=\"noopener noreferrer nofollow\">CloudFront<\/a> \u2192 <a href=\"https:\/\/console.aws.amazon.com\/cloudfront\/v4\/home#\/distributions\" rel=\"noopener noreferrer nofollow\">Distributions<\/a> \u2192 <a href=\"https:\/\/console.aws.amazon.com\/cloudfront\/v4\/home#\/distributions\/create\" rel=\"noopener noreferrer nofollow\">Create distribution<\/a><br \/>Origin domain: \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 <a href=\"http:\/\/example-com.s3.amazonaws.com\" rel=\"noopener noreferrer nofollow\">example-com.s3.amazonaws.com<\/a> (\u044d\u0442\u043e S3 \u0431\u0430\u043a\u0435\u0442, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0448\u0430\u0433\u0435).<br \/>Origin access: Origin access control settings (recommended)<br \/>\u041d\u0430\u0436\u0430\u0442\u044c Create control setting. \u041d\u0430\u0436\u0430\u0442\u044c Create. \u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0435\u0433\u043e \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430.<br \/>\u041f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435: You must update the S3 bucket policy<br \/>Viewer protocol policy: <strong>Redirect HTTP to HTTPS<\/strong> (\u0434\u043b\u044f \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0430 <a href=\"http:\/\/example.com\" rel=\"noopener noreferrer nofollow\">http:\/\/example.com<\/a> \u2192 <a href=\"https:\/\/example.com\" rel=\"noopener noreferrer nofollow\">https:\/\/example.com<\/a>)<br \/>\u041e\u0442\u043c\u0435\u0442\u0438\u0442\u044c Do not enable security protections<br \/>Price class: \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u043f\u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0443 \u0446\u0435\u043d\u0430\/\u0432\u0440\u0435\u043c\u044f \u043e\u0442\u043a\u043b\u0438\u043a\u0430.<br \/>Alternate domain name (CNAME) \u2192 Add item \u2192 <strong>example.com<\/strong><br \/>Custom SSL certificate: \u0412\u044b\u0431\u0440\u0430\u0442\u044c SSL \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430.<br \/>Default root object: <strong>index.html<\/strong><br \/>\u041d\u0430\u0436\u0430\u0442\u044c Create distribution.<\/p>\n<h4>CloudFront \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0430 www.example.com \u2192 example.com<\/h4>\n<p><a href=\"https:\/\/docs.aws.amazon.com\/AmazonCloudFront\/latest\/DeveloperGuide\/cloudfront-functions.html\" rel=\"noopener noreferrer nofollow\">CloudFront Functions<\/a> \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u0432 2021\u0433. \u043a\u0430\u043a \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0438 \u0434\u0435\u0448\u0451\u0432\u0430\u044f \u0437\u0430\u043c\u0435\u043d\u0430 <a href=\"https:\/\/aws.amazon.com\/lambda\/edge\/\" rel=\"noopener noreferrer nofollow\"><u>Lambda@Edge<\/u><\/a> \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 HTTP \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0438 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432. \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u0432\u043e \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c CloudFront distribution (www.example.com) \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0448\u0430\u0433\u0435. \u041a\u043e\u0433\u0434\u0430 \u0431\u0440\u0430\u0437\u0435\u0440 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0438\u0437 distribution, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u0430 \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043e\u043d\u0430 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e, \u0431\u0435\u0437 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0444\u0430\u0439\u043b\u0430\u043c \u0432 S3, \u0432\u0435\u0440\u043d\u0451\u0442 HTTP \u043e\u0442\u0432\u0435\u0442 \u0441 \u043a\u043e\u0434\u043e\u043c 301 (Permanently Moved) \u0438 \u043d\u043e\u0432\u044b\u043c URL, https:\/\/example.com.<\/p>\n<p><a href=\"https:\/\/console.aws.amazon.com\/cloudfront\/v4\/home\" rel=\"noopener noreferrer nofollow\">CloudFront<\/a> \u2192 <a href=\"https:\/\/console.aws.amazon.com\/cloudfront\/v3\/home#\/functions\" rel=\"noopener noreferrer nofollow\">Functions<\/a> \u2192 <a href=\"https:\/\/console.aws.amazon.com\/cloudfront\/v3\/home#\/functions\/create\" rel=\"noopener noreferrer nofollow\">Create function<\/a><br \/>Name: Redirect-www-example-com<br \/>Description: Redirect www.example.com to https:\/\/example.com<br \/>\u041d\u0430\u0436\u0430\u0442\u044c Create function.<br \/>\u041d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 Development \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 \u0442\u0430\u043a\u043e\u0439, \u0438\u0437\u043c\u0435\u043d\u0438\u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0430 <code>location<\/code> \u043d\u0430 \u0441\u0432\u043e\u0439 \u0434\u043e\u043c\u0435\u043d:<\/p>\n<pre><code class=\"javascript\">function handler(event) {     \/\/ NOTE: This example function is for a viewer request event trigger.      \/\/ Choose viewer request for event trigger when you associate this function with a distribution.      var response = {         statusCode: 301,         statusDescription: 'Moved Permanently',         headers: {             'cloudfront-functions': { value: 'generated-by-CloudFront-Functions' },             'location': { value: 'https:\/\/example.com' }         }     };     return response; } <\/code><\/pre>\n<p>\u041d\u0430\u0436\u0430\u0442\u044c Save changes. \u0412\u043a\u043b\u0430\u0434\u043a\u0430 Publish \u2192 \u043a\u043d\u043e\u043f\u043a\u0430 Publish function.<\/p>\n<h4>CloudFront distribution \u0434\u043b\u044f \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0430 www.example.com \u2192 example.com<\/h4>\n<p><a href=\"https:\/\/console.aws.amazon.com\/cloudfront\/v4\/home\" rel=\"noopener noreferrer nofollow\">CloudFront<\/a> \u2192 <a href=\"https:\/\/console.aws.amazon.com\/cloudfront\/v4\/home#\/distributions\" rel=\"noopener noreferrer nofollow\">Distributions<\/a> \u2192 <a href=\"https:\/\/console.aws.amazon.com\/cloudfront\/v4\/home#\/distributions\/create\" rel=\"noopener noreferrer nofollow\">Create distribution<\/a><br \/>Origin domain: \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 <a href=\"http:\/\/example-com.s3.amazonaws.com\" rel=\"noopener noreferrer nofollow\">example-com.s3.amazonaws.com<\/a> (\u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u0432\u0430\u0436\u043d\u043e, \u0442.\u043a. \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442).<br \/>Origin access: Origin access control settings (recommended)<br \/>Origin access control: \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439.<br \/>Viewer protocol policy: <strong>HTTP and HTTPS<\/strong><br \/>\u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 Function associations, \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 Viewer request \u0432\u044b\u0431\u0440\u0430\u0442\u044c CloudFront Functions, \u0432\u044b\u0431\u0440\u0430\u0442\u044c Redirect-www-example-com (\u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0448\u0430\u0433\u0435)<br \/>\u041e\u0442\u043c\u0435\u0442\u0438\u0442\u044c Do not enable security protections<br \/>Price class: \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u043f\u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0443 \u0446\u0435\u043d\u0430\/\u0432\u0440\u0435\u043c\u044f \u043e\u0442\u043a\u043b\u0438\u043a\u0430.<br \/>Alternate domain name (CNAME) \u2192 Add item \u2192 <strong>www.example.com<\/strong><br \/>Custom SSL certificate: \u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0442\u043e\u0442 \u0436\u0435 SSL \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430.<br \/>Default root object: \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u043c (\u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f).<br \/>\u041d\u0430\u0436\u0430\u0442\u044c Create distribution.<br \/>\u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f distribution \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0431\u0443\u0444\u0435\u0440 \u0442\u0435\u043a\u0441\u0442 policy \u0434\u043b\u044f S3.<br \/>\u0422\u0435\u043a\u0441\u0442 policy \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 <a href=\"https:\/\/s3.console.aws.amazon.com\/s3\/home\" rel=\"noopener noreferrer nofollow\">S3<\/a> \u2192 example-com \u2192 Permissions \u2192 Bucket policy.<\/p>\n<h4>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 A-\u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u043b\u044f example.com<\/h4>\n<p><a href=\"https:\/\/console.aws.amazon.com\/route53\/v2\/home\" rel=\"noopener noreferrer nofollow\">Route 53<\/a> \u2192 <a href=\"https:\/\/us-east-1.console.aws.amazon.com\/route53\/v2\/hostedzones\" rel=\"noopener noreferrer nofollow\">Hosted zones<\/a> \u2192 example.com<br \/>Create record.<br \/>Record name: example.com (\u043f\u043e\u043b\u0435 \u0432\u0432\u043e\u0434\u0430 subdomain &#8212; \u043f\u0443\u0441\u0442\u043e\u0435)<br \/>Record type: A.<br \/>Alias: Yes.<br \/>Route traffic to: Alias to CloudFront distribution.<br \/>Choose distribution: example.com (*.cloudfront.net).<br \/>\u041d\u0430\u0436\u0430\u0442\u044c Create records.<\/p>\n<h4>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 A-\u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u043b\u044f www.example.com<\/h4>\n<p><a href=\"https:\/\/console.aws.amazon.com\/route53\/v2\/home\" rel=\"noopener noreferrer nofollow\">Route 53<\/a> \u2192 <a href=\"https:\/\/us-east-1.console.aws.amazon.com\/route53\/v2\/hostedzones\" rel=\"noopener noreferrer nofollow\">Hosted zones<\/a> \u2192 example.com<br \/>Create record.<br \/>Record name: www.example.com (\u0432 \u043f\u043e\u043b\u0435 \u0432\u0432\u043e\u0434\u0430 subdomain \u0432\u043f\u0438\u0441\u0430\u0442\u044c <code>www<\/code>)<br \/>Record type: A.<br \/>Alias: Yes.<br \/>Route traffic to: Alias to CloudFront distribution.<br \/>Choose distribution: www.example.com (*.cloudfront.net).<br \/>\u041d\u0430\u0436\u0430\u0442\u044c Create records.<br \/>\u041e\u0431\u044b\u0447\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0438 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u044b \u043c\u0438\u043d\u0443\u0442.<\/p>\n<h4>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h4>\n<p>\u0421\u0430\u0439\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435 <a href=\"https:\/\/example.com\" rel=\"noopener noreferrer nofollow\">https:\/\/example.com<\/a>.<br \/>CloudFront \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0443\u044e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0444\u0430\u0439\u043b\u043e\u0432 \u0441\u0430\u0439\u0442\u0430 \u043f\u0440\u0438 \u043b\u044e\u0431\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0435. \u041e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f.<br \/>\u0421\u0441\u044b\u043b\u043a\u0438 <a href=\"http:\/\/www.example.com\" rel=\"noopener noreferrer nofollow\">http:\/\/www.example.com<\/a>, <a href=\"https:\/\/www.example.com\" rel=\"noopener noreferrer nofollow\">https:\/\/www.example.com<\/a>, <a href=\"http:\/\/example.com\" rel=\"noopener noreferrer nofollow\">http:\/\/example.com<\/a> \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442 (HTTP code 301) \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0430\u0439\u0442 <a href=\"https:\/\/example.com\" rel=\"noopener noreferrer nofollow\">https:\/\/example.com<\/a>.<br \/>\u041e\u0431\u0440\u0430\u0442\u043d\u043e\u0435 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 (<a href=\"http:\/\/example.com\" rel=\"noopener noreferrer nofollow\">example.com<\/a> \u2192 <a href=\"http:\/\/www.example.com\" rel=\"noopener noreferrer nofollow\">www.example.com<\/a>) \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0445\u043e\u0436\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<p>\u0422\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0445\u043e\u0441\u0442\u0438\u043d\u0433\u0430 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u043d\u0435\u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439. \u041f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0442\u044f\u0436\u0451\u043b\u043e\u0439 \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0438 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u0430\u044f \u0446\u0435\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0432\u044b\u0441\u043e\u043a\u043e\u0432\u0430\u0442\u0430 \u0438 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0434\u0443\u043c\u0430\u0442\u044c\u0441\u044f \u043e\u0431 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430\u0445.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/783910\/\"> https:\/\/habr.com\/ru\/articles\/783910\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-364303","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/364303","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=364303"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/364303\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=364303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=364303"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=364303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}