{"id":368349,"date":"2024-05-21T03:40:50","date_gmt":"2024-05-21T03:40:50","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=368349"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=368349","title":{"rendered":"<span>\u0425\u0440\u0430\u043d\u0438\u043c \u0444\u0430\u0439\u043b\u044b Strapi \u0432 \u043e\u0431\u043b\u0430\u043a\u0435 Selectel<\/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>\u041f\u0440\u0438\u0432\u0435\u0442, \u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u043d\u0430\u0434 \u0441\u0432\u043e\u0438\u043c \u043f\u0435\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c, \u0433\u0434\u0435 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c \u0444\u0440\u043e\u043d\u0442\u043e\u043c, \u0430 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e headless CMS \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c\u00a0<a href=\"http:\/\/strapi.io\/\" rel=\"noopener noreferrer nofollow\">strapi.io<\/a>. \u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u043c\u0435\u0434\u0438\u0430 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0438\u0437 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0438 \u0432 \u043e\u0431\u043b\u0430\u043a\u043e. \u0410 \u0442\u0430\u043a-\u043a\u0430\u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0443\u0436\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0441\u044f \u0434\u043e\u043b\u0433\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 Selectel, \u044f \u0440\u0435\u0448\u0438\u043b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u043c \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435\u043c \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0441\u044f \u043a \u043d\u0435\u043c\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u201c@strapi\/provider-upload-aws-s3\u201c. \u0418 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0432\u0430\u043c \u043e\u043f\u0438\u0448\u0443 \u043a\u0440\u0430\u0442\u043a\u0438\u0439 \u0433\u0430\u0439\u0434 \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0443 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c strapi \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u043d\u043e\u0439 \u043a 4.20.0, \u0438 \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0432 Selectel. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u0430\u0431\u0438\u043d\u0435\u0442, \u0438\u0449\u0435\u043c \u0432 \u0441\u0430\u0439\u0434\u0431\u0430\u0440\u0435 \u0440\u0430\u0437\u0434\u0435\u043b \u201c\u041e\u0431\u043b\u0430\u0447\u043d\u044b\u0435 \u0443\u0441\u043b\u0443\u0433\u0438\u201d \u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u201c\u041e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435\u201d. \u041a\u043b\u0438\u043a\u0430\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443 \u201c\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u201d \u0438 \u0432\u0438\u0434\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d19\/f11\/a35\/d19f11a35ebbd331a55255ee8d560071.png\" alt=\"Untitled\" title=\"\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432 Selectel\" width=\"2878\" height=\"1634\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d19\/f11\/a35\/d19f11a35ebbd331a55255ee8d560071.png\"\/><\/p>\n<div><figcaption>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432 Selectel<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0438\u043c\u044f, \u043e\u043d\u043e \u0441\u0442\u0430\u043d\u0435\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0434\u043b\u044f s3, \u0442\u0430\u043a \u0447\u0442\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0435 \u0431\u0443\u043a\u0432\u044b \u0438 \u0442\u0438\u0440\u0435. \u0422\u0438\u043f &#8212; \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439, \u0438\u0431\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043d\u0430 \u0441\u0430\u0439\u0442\u0435. \u0418 \u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u044f &#8212; \u0433\u0430\u043b\u043e\u0447\u043a\u0430 \u043d\u0430 Virtual-Hosted, \u043d\u0438\u0436\u0435 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u0438\u0437 \u0434\u043e\u043a\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430.<\/p>\n<blockquote>\n<p>AWS SDK V3 adopts the virtual-hosted\u2013style URI format for S3 URLs. This format is recommended by AWS and is likely to become required in the near future, as the path-style URI is being deprecated. More details on this format can be found in the\u00a0<a href=\"https:\/\/docs.aws.amazon.com\/AmazonS3\/latest\/userguide\/VirtualHosting.html#virtual-hosted-style-access\" rel=\"noopener noreferrer nofollow\">AWS User Guide<\/a>.<\/p>\n<\/blockquote>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u0441\u044f \u0432 \u201c\u041f\u0440\u043e\u0444\u0438\u043b\u044c \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438\u201d, \u0442\u0430\u043c \u0438\u0449\u0435\u043c \u0432\u043a\u043b\u0430\u0434\u043a\u0443 &#171;\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438\u201d \u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443 \u201c\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u201d.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8fd\/428\/c81\/8fd428c8167d3588a64761259fcc9523.png\" alt=\"Untitled\" title=\"\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 Selectel\" width=\"2874\" height=\"1634\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8fd\/428\/c81\/8fd428c8167d3588a64761259fcc9523.png\"\/><\/p>\n<div><figcaption>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 Selectel<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0442\u0438\u043f \u043d\u0430 \u201c\u0421\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u201d, \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0440\u043e\u043b\u044c \u201c\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430\u201d \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0437\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u043d\u0435\u0433\u043e, \u043b\u0438\u0441\u0442\u0430\u0435\u043c \u0434\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u201cS3 \u043a\u043b\u044e\u0447\u0438\u201d, \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u201c\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043b\u044e\u0447\u201d, \u0441\u043d\u043e\u0432\u0430 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c Access key \u0438 Secret key.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4ec\/0e4\/666\/4ec0e4666a6424c831f052c7ffda4e23.png\" alt=\"Untitled\" title=\"\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 S3 \u043a\u043b\u044e\u0447\u0430 \u0432 Selectel\" width=\"2878\" height=\"1644\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4ec\/0e4\/666\/4ec0e4666a6424c831f052c7ffda4e23.png\"\/><\/p>\n<div><figcaption>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 S3 \u043a\u043b\u044e\u0447\u0430 \u0432 Selectel<\/figcaption><\/div>\n<\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u043a\u043b\u044e\u0447\u0438, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0441\u0440\u0430\u0437\u0443 \u0438\u0445 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"bash\"># .env  AWS_ENDPOINT=https:\/\/s3.storage.selcloud.ru AWS_REGION=ru-1 AWS_ACCESS_KEY_ID=&lt;Access key> AWS_ACCESS_SECRET=&lt;Secret key> AWS_BUCKET=&lt;\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430><\/code><\/pre>\n<p>\u0412 \u043f\u0440\u043e\u0435\u043a\u0442 strapi \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u201c@strapi\/provider-upload-aws-s3\u201c, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430.<\/p>\n<pre><code class=\"typescript\">\/\/ path: .\/config\/plugins.ts  export default ({ env }) => ({   upload: {     config: {       provider: \"aws-s3\",       providerOptions: {         s3Options: {           endpoint: env(\"AWS_ENDPOINT\"),           credentials: {             accessKeyId: env(\"AWS_ACCESS_KEY_ID\"),             secretAccessKey: env(\"AWS_ACCESS_SECRET\"),           },           params: {             Bucket: env(\"AWS_BUCKET\"),           },         },       },     },   }, })<\/code><\/pre>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u0432 Selectel, \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0432\u044b\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u043e\u043c\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0443. \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u043d\u0430\u0448\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u201c\u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430\u201d \u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u201c\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 \u0434\u043e\u0441\u0442\u0443\u043f\u0430\u201d.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d43\/f39\/93f\/d43f3993fcad5ce4e54a994f14cf44d7.png\" alt=\"Untitled\" title=\"\u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0443 \u0432 Selectel\" width=\"2878\" height=\"1630\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d43\/f39\/93f\/d43f3993fcad5ce4e54a994f14cf44d7.png\"\/><\/p>\n<div><figcaption>\u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0443 \u0432 Selectel<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 &#8212; \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043d\u0430\u0431\u043e\u0440 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 &#8212; \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440. \u0418 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0449\u0435 \u043e\u0434\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u0430\u043d\u0435\u043b\u0438 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u043c \u0438\u0437 \u043b\u0438\u0447\u043d\u043e\u0433\u043e \u043a\u0430\u0431\u0438\u043d\u0435\u0442\u0430 Selectel.<\/p>\n<p>\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u201c\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c\u201d \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 Strapi, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d17\/d28\/6c5\/d17d286c51e78c88697960aed38c59cd.png\" alt=\"Untitled\" title=\"\u041c\u0435\u0434\u0438\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0432 Strapi\" width=\"2870\" height=\"1566\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d17\/d28\/6c5\/d17d286c51e78c88697960aed38c59cd.png\"\/><\/p>\n<div><figcaption>\u041c\u0435\u0434\u0438\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0432 Strapi<\/figcaption><\/div>\n<\/figure>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f, \u0438 \u043d\u0430\u0434 \u044d\u0442\u0438\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c \u044f \u0434\u043e\u043b\u0433\u043e \u043b\u043e\u043c\u0430\u043b \u0433\u043e\u043b\u043e\u0432\u0443, \u043d\u043e \u043f\u043e\u0441\u043b\u0435 \u043a\u0440\u0443\u043f\u043d\u043e\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043b\u0438\u0447\u043d\u043e\u0433\u043e \u043a\u0430\u0431\u0438\u043d\u0435\u0442\u0430 Selectel \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430\u0448\u043b\u043e\u0441\u044c \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e. \u0412 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u043c\u044b \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u0442\u0438\u043f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 &#8212; \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439, \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0435 \u201c\u0414\u043e\u043c\u0435\u043d\u044b\u201d \u043c\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0434\u043e\u043c\u0435\u043d \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0433\u043e \u0432 \u0444\u0430\u0439\u043b \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430.<\/p>\n<pre><code class=\"bash\"># .env  CDN_URL=&lt;\u041f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0434\u043e\u043c\u0435\u043d \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430><\/code><\/pre>\n<pre><code class=\"typescript\">\/\/ path: .\/config\/plugins.ts  provider: \"aws-s3\", providerOptions: {   baseUrl: env(\"CDN_URL\"),   s3Options: {   ...<\/code><\/pre>\n<p>\u0410 \u0442\u0430\u043a \u0436\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e Content Security Policy (CSP), \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u0437\u044f\u0442 \u0438\u0437 \u0434\u043e\u043a\u0438 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430.<\/p>\n<pre><code class=\"typescript\">\/\/ path: .\/config\/middlewares.ts  export default ({ env }) => [   ...   {     name: \"strapi::security\",     config: {       contentSecurityPolicy: {         useDefaults: true,         directives: {           \"connect-src\": [\"'self'\", \"https:\"],           \"img-src\": [           \"'self'\",           \"data:\",           \"blob:\",           \"https:\/\/strapi.io\",           \"https:\/\/market-assets.strapi.io\",           env(\"CDN_URL\"),         ],         \"media-src\": [           \"'self'\",           \"data:\",           \"blob:\",           \"https:\/\/strapi.io\",           \"https:\/\/market-assets.strapi.io\",           env(\"CDN_URL\"),         ],         upgradeInsecureRequests: null,         },       },     },   },   ...<\/code><\/pre>\n<p>\u0423\u0434\u0430\u043b\u044f\u0435\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0437\u0430\u043d\u043e\u0432\u043e. \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bb6\/f5c\/d39\/bb6f5cd39a316e2d8a4e9a7c0870914d.png\" alt=\"Untitled\" title=\"\u041c\u0435\u0434\u0438\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0432 Strapi\" width=\"2872\" height=\"1566\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bb6\/f5c\/d39\/bb6f5cd39a316e2d8a4e9a7c0870914d.png\"\/><\/p>\n<div><figcaption>\u041c\u0435\u0434\u0438\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0432 Strapi<\/figcaption><\/div>\n<\/figure>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0434\u043e\u043c\u0435\u043d\u0430 Selectel \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0438\u043b\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0443\u0441\u043b\u0443\u0433\u043e\u0439 CDN. \u041d\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0435. \u0414\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0438!<\/p>\n<\/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\/794092\/\"> https:\/\/habr.com\/ru\/articles\/794092\/<\/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>\u041f\u0440\u0438\u0432\u0435\u0442, \u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u043d\u0430\u0434 \u0441\u0432\u043e\u0438\u043c \u043f\u0435\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c, \u0433\u0434\u0435 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c \u0444\u0440\u043e\u043d\u0442\u043e\u043c, \u0430 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e headless CMS \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c\u00a0<a href=\"http:\/\/strapi.io\/\" rel=\"noopener noreferrer nofollow\">strapi.io<\/a>. \u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u043c\u0435\u0434\u0438\u0430 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0438\u0437 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0438 \u0432 \u043e\u0431\u043b\u0430\u043a\u043e. \u0410 \u0442\u0430\u043a-\u043a\u0430\u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0443\u0436\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0441\u044f \u0434\u043e\u043b\u0433\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 Selectel, \u044f \u0440\u0435\u0448\u0438\u043b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u043c \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435\u043c \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0441\u044f \u043a \u043d\u0435\u043c\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u201c@strapi\/provider-upload-aws-s3\u201c. \u0418 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0432\u0430\u043c \u043e\u043f\u0438\u0448\u0443 \u043a\u0440\u0430\u0442\u043a\u0438\u0439 \u0433\u0430\u0439\u0434 \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0443 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c strapi \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u043d\u043e\u0439 \u043a 4.20.0, \u0438 \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0432 Selectel. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043b\u0438\u0447\u043d\u044b\u0439 \u043a\u0430\u0431\u0438\u043d\u0435\u0442, \u0438\u0449\u0435\u043c \u0432 \u0441\u0430\u0439\u0434\u0431\u0430\u0440\u0435 \u0440\u0430\u0437\u0434\u0435\u043b \u201c\u041e\u0431\u043b\u0430\u0447\u043d\u044b\u0435 \u0443\u0441\u043b\u0443\u0433\u0438\u201d \u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u201c\u041e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435\u201d. \u041a\u043b\u0438\u043a\u0430\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443 \u201c\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u201d \u0438 \u0432\u0438\u0434\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432 Selectel<\/figcaption><\/div>\n<\/figure>\n<p>\u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0438\u043c\u044f, \u043e\u043d\u043e \u0441\u0442\u0430\u043d\u0435\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0434\u043b\u044f s3, \u0442\u0430\u043a \u0447\u0442\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0435 \u0431\u0443\u043a\u0432\u044b \u0438 \u0442\u0438\u0440\u0435. \u0422\u0438\u043f &#8212; \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439, \u0438\u0431\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043d\u0430 \u0441\u0430\u0439\u0442\u0435. \u0418 \u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u044f &#8212; \u0433\u0430\u043b\u043e\u0447\u043a\u0430 \u043d\u0430 Virtual-Hosted, \u043d\u0438\u0436\u0435 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u0438\u0437 \u0434\u043e\u043a\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430.<\/p>\n<blockquote>\n<p>AWS SDK V3 adopts the virtual-hosted\u2013style URI format for S3 URLs. This format is recommended by AWS and is likely to become required in the near future, as the path-style URI is being deprecated. More details on this format can be found in the\u00a0<a href=\"https:\/\/docs.aws.amazon.com\/AmazonS3\/latest\/userguide\/VirtualHosting.html#virtual-hosted-style-access\" rel=\"noopener noreferrer nofollow\">AWS User Guide<\/a>.<\/p>\n<\/blockquote>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u0441\u044f \u0432 \u201c\u041f\u0440\u043e\u0444\u0438\u043b\u044c \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438\u201d, \u0442\u0430\u043c \u0438\u0449\u0435\u043c \u0432\u043a\u043b\u0430\u0434\u043a\u0443 &#171;\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438\u201d \u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443 \u201c\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u201d.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 Selectel<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0442\u0438\u043f \u043d\u0430 \u201c\u0421\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u201d, \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0440\u043e\u043b\u044c \u201c\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430\u201d \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0437\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u043d\u0435\u0433\u043e, \u043b\u0438\u0441\u0442\u0430\u0435\u043c \u0434\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u201cS3 \u043a\u043b\u044e\u0447\u0438\u201d, \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u201c\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043b\u044e\u0447\u201d, \u0441\u043d\u043e\u0432\u0430 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c Access key \u0438 Secret key.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 S3 \u043a\u043b\u044e\u0447\u0430 \u0432 Selectel<\/figcaption><\/div>\n<\/figure>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u043a\u043b\u044e\u0447\u0438, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0441\u0440\u0430\u0437\u0443 \u0438\u0445 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"bash\"># .env  AWS_ENDPOINT=https:\/\/s3.storage.selcloud.ru AWS_REGION=ru-1 AWS_ACCESS_KEY_ID=&lt;Access key> AWS_ACCESS_SECRET=&lt;Secret key> AWS_BUCKET=&lt;\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430><\/code><\/pre>\n<p>\u0412 \u043f\u0440\u043e\u0435\u043a\u0442 strapi \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u201c@strapi\/provider-upload-aws-s3\u201c, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430.<\/p>\n<pre><code class=\"typescript\">\/\/ path: .\/config\/plugins.ts  export default ({ env }) => ({   upload: {     config: {       provider: \"aws-s3\",       providerOptions: {         s3Options: {           endpoint: env(\"AWS_ENDPOINT\"),           credentials: {             accessKeyId: env(\"AWS_ACCESS_KEY_ID\"),             secretAccessKey: env(\"AWS_ACCESS_SECRET\"),           },           params: {             Bucket: env(\"AWS_BUCKET\"),           },         },       },     },   }, })<\/code><\/pre>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u0432 Selectel, \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0432\u044b\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u043e\u043c\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0443. \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u043d\u0430\u0448\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u201c\u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430\u201d \u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u201c\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 \u0434\u043e\u0441\u0442\u0443\u043f\u0430\u201d.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0443 \u0432 Selectel<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 &#8212; \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043d\u0430\u0431\u043e\u0440 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 &#8212; \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440. \u0418 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0449\u0435 \u043e\u0434\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u0430\u043d\u0435\u043b\u0438 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u043c \u0438\u0437 \u043b\u0438\u0447\u043d\u043e\u0433\u043e \u043a\u0430\u0431\u0438\u043d\u0435\u0442\u0430 Selectel.<\/p>\n<p>\u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u201c\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c\u201d \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 Strapi, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041c\u0435\u0434\u0438\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0432 Strapi<\/figcaption><\/div>\n<\/figure>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f, \u0438 \u043d\u0430\u0434 \u044d\u0442\u0438\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c \u044f \u0434\u043e\u043b\u0433\u043e \u043b\u043e\u043c\u0430\u043b \u0433\u043e\u043b\u043e\u0432\u0443, \u043d\u043e \u043f\u043e\u0441\u043b\u0435 \u043a\u0440\u0443\u043f\u043d\u043e\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043b\u0438\u0447\u043d\u043e\u0433\u043e \u043a\u0430\u0431\u0438\u043d\u0435\u0442\u0430 Selectel \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430\u0448\u043b\u043e\u0441\u044c \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e. \u0412 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u043c\u044b \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u0442\u0438\u043f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 &#8212; \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439, \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0435 \u201c\u0414\u043e\u043c\u0435\u043d\u044b\u201d \u043c\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0434\u043e\u043c\u0435\u043d \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0433\u043e \u0432 \u0444\u0430\u0439\u043b \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430.<\/p>\n<pre><code class=\"bash\"># .env  CDN_URL=&lt;\u041f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0434\u043e\u043c\u0435\u043d \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430><\/code><\/pre>\n<pre><code class=\"typescript\">\/\/ path: .\/config\/plugins.ts  provider: \"aws-s3\", providerOptions: {   baseUrl: env(\"CDN_URL\"),   s3Options: {   ...<\/code><\/pre>\n<p>\u0410 \u0442\u0430\u043a \u0436\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e Content Security Policy (CSP), \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u0437\u044f\u0442 \u0438\u0437 \u0434\u043e\u043a\u0438 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430.<\/p>\n<pre><code class=\"typescript\">\/\/ path: .\/config\/middlewares.ts  export default ({ env }) => [   ...   {     name: \"strapi::security\",     config: {       contentSecurityPolicy: {         useDefaults: true,         directives: {           \"connect-src\": [\"'self'\", \"https:\"],           \"img-src\": [           \"'self'\",           \"data:\",           \"blob:\",           \"https:\/\/strapi.io\",           \"https:\/\/market-assets.strapi.io\",           env(\"CDN_URL\"),         ],         \"media-src\": [           \"'self'\",           \"data:\",           \"blob:\",           \"https:\/\/strapi.io\",           \"https:\/\/market-assets.strapi.io\",           env(\"CDN_URL\"),         ],         upgradeInsecureRequests: null,         },       },     },   },   ...<\/code><\/pre>\n<p>\u0423\u0434\u0430\u043b\u044f\u0435\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0437\u0430\u043d\u043e\u0432\u043e. \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041c\u0435\u0434\u0438\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0432 Strapi<\/figcaption><\/div>\n<\/figure>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0434\u043e\u043c\u0435\u043d\u0430 Selectel \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0438\u043b\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0443\u0441\u043b\u0443\u0433\u043e\u0439 CDN. \u041d\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0435. \u0414\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0438!<\/p>\n<\/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\/794092\/\"> https:\/\/habr.com\/ru\/articles\/794092\/<\/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-368349","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/368349","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=368349"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/368349\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=368349"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=368349"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=368349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}