You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/configuration/options.mdx
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -460,7 +460,6 @@ imgproxy can process files from Amazon S3 buckets, but this feature is disabled
460
460
*[`IMGPROXY_S3_REGION`]: an S3 buckets region
461
461
*[`IMGPROXY_S3_ENDPOINT`]: a custom S3 endpoint to being used by imgproxy
462
462
*[`IMGPROXY_S3_ENDPOINT_USE_PATH_STYLE`]: controls how the S3 bucket endpoint is constructed. When `true`, the endpoint will be constructed using the path style (`https://your-endpoint.com/%bucket`). When `false`, the endpoint will be constructed using the virtual host style (`https://%bucket.your-endpoint.com`). Default: `true`
463
-
*[`IMGPROXY_S3_MULTI_REGION`]: when `true`, allows using S3 buckets from different regions. Default: `false`
464
463
*[`IMGPROXY_S3_USE_DECRYPTION_CLIENT`]: when `true`, enables client-side decryption. Default: `false`
465
464
*[`IMGPROXY_S3_ASSUME_ROLE_ARN`]: a custom role to assume
466
465
*[`IMGPROXY_S3_ASSUME_ROLE_EXTERNAL_ID`]: the external ID required to assume a custom role
Copy file name to clipboardExpand all lines: docs/image_sources/amazon_s3.mdx
+12-9Lines changed: 12 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,13 +8,12 @@ imgproxy can process images from S3 buckets. To use this feature, do the followi
8
8
9
9
1. Set the `IMGPROXY_USE_S3` environment variable to be `true`.
10
10
2.[Set up the necessary credentials](#set-up-credentials) to grant access to your bucket.
11
-
3._(optional)_ Specify the AWS region with `IMGPROXY_S3_REGION` or `AWS_REGION`. Default: `us-west-1`
11
+
3._(optional)_ Specify the [AWS region](#choosing-the-aws-region) with `IMGPROXY_S3_REGION` or `AWS_REGION`. Default: `us-west-1`
12
12
4._(optional)_ Specify the S3 endpoint with `IMGPROXY_S3_ENDPOINT`. You can also set `IMGPROXY_S3_ENDPOINT_USE_PATH_STYLE=false` to use the virtual host style for the endpoint.
13
-
5._(optional)_ Set the `IMGPROXY_S3_MULTI_REGION` environment variable to be `true`.
14
-
6._(optional)_ Set the `IMGPROXY_S3_USE_DECRYPTION_CLIENT` environment variable to `true` if your objects are client-side encrypted.
15
-
7._(optional)_ Specify the AWS IAM Role to Assume with `IMGPROXY_S3_ASSUME_ROLE_ARN`.
16
-
8._(optional)_ Specify the External ID that needs to be passed in along with the AWS IAM Role to Assume with `IMGPROXY_S3_ASSUME_ROLE_EXTERNAL_ID`. This will have no effect if the assume role ARN is not specified.
17
-
9. Use `s3://%bucket_name/%file_key` as the source image URL.
13
+
5._(optional)_ Set the `IMGPROXY_S3_USE_DECRYPTION_CLIENT` environment variable to `true` if your objects are client-side encrypted.
14
+
6._(optional)_ Specify the AWS IAM Role to Assume with `IMGPROXY_S3_ASSUME_ROLE_ARN`.
15
+
7._(optional)_ Specify the External ID that needs to be passed in along with the AWS IAM Role to Assume with `IMGPROXY_S3_ASSUME_ROLE_EXTERNAL_ID`. This will have no effect if the assume role ARN is not specified.
16
+
8. Use `s3://%bucket_name/%file_key` as the source image URL.
18
17
19
18
If you need to specify the version of the source object, you can use the query string of the source URL:
S3 access credentials may be acquired by assuming a role using STS. To do so specify the IAM Role arn with the `IMGPROXY_S3_ASSUME_ROLE_ARN` environment variable. Additionally, if you require an external ID to be passed when assuming a role, specify the `IMGPROXY_S3_ASSUME_ROLE_EXTERNAL_ID` environment variable. This approach still requires you to provide initial AWS credentials by using one of the ways described above. The provided credentials role should allow assuming the role with provided ARN.
71
70
72
-
## Multi-Region mode
71
+
## Choosing the AWS region
73
72
74
-
By default, imgproxy allows using S3 buckets located in a single region specified with `IMGPROXY_S3_REGION` or `AWS_REGION`. If your buckets are located in different regions, set `IMGPROXY_S3_MULTI_REGION` environment variable to be `true` to enable multi-region mode. In this mode, imgproxy will make an additional request to determine the bucket's region when the bucket is accessed for the first time.
73
+
The AWS region specified with the `IMGPROXY_S3_REGION` or `AWS_REGION` environment variable determines the S3 endpoint used by imgproxy for the initial request to the bucket. If AWS reports that the bucket is in a different region, imgproxy will remember this, retry the request, and use the new region for all subsequent requests for this bucket.
75
74
76
-
In this mode, imgroxy uses a region specified with `IMGPROXY_S3_REGION` or `AWS_REGION` to determine the endpoint to which it should send the bucket's region determination request. Thus, it's a good idea to use one of these variables to specify a region closest to the imgproxy instance.
75
+
This allows imgproxy to access buckets in any region. However, the initial request to the bucket in a different region than the one specified in the environment variable may add some latency. Thus, the rule of thumb for the best performance is the following:
76
+
77
+
* If you are going to use only one bucket, set the region to the one where the bucket is located.
78
+
* If your most frequently used buckets are in the same region, set the region to that one.
79
+
* If your buckets are spread across multiple regions, set the region to the closest one to your imgproxy instance.
0 commit comments